#P6546. [COCI 2010/2011 #2] PUŽ

[COCI 2010/2011 #2] PUŽ

Description

Snail climbing a well problem: A snail needs to climb to the top of a tree stump that is vv meters high. Every day, it climbs up aa meters during the day, and slips down bb meters at night. After how many days can it reach the top of the stump?

Input Format

One line with three integers aa, bb, and vv, separated by spaces.

Output Format

One line with one integer, the answer.

2 1 5
4
5 1 6
2
100 99 1000000000
999999901

Hint

Constraints

For 100%100\% of the testdata, it is guaranteed that 1b<av1×1091 \leq b < a \leq v \leq 1 \times 10^9.

Notes

  • This problem is worth 3030 points in total.
  • Translated from COCI2010-2011 CONTEST #2 PUŽ. Translator:
    https://www.luogu.com.cn/user/115711

Hint

Please derive the formula for the result. A simple simulation may cause TLE.

Translated by ChatGPT 5