Climbing Snail
InterviewTime limit0.25sMemory limit128 MB
Compute the number of days for a snail climbing A meters by day and sliding B meters by night to reach a pole of height V.
- Level
Easy2 of 10
- Topics
- Math, Simulation
- Solved
- No attempts yet
Problem
A snail on the ground wants to climb a wooden pole that is V meters tall.
During the day, the snail climbs A meters. While sleeping at night, it slides down B meters. However, once it reaches the top of the pole, it does not slide back down.
Determine how many days the snail needs to reach the top of the pole.
Input
The first line contains three integers A, B, and V, separated by spaces.
1 <= B < A <= V <= 1,000,000,000
Output
Print the number of days needed for the snail to reach the top of the wooden pole.