Climbing Worm
Time limit1sMemory limit1024 MB
Given a climb a, a slide b, and a pole height h, the task is to count how many crawls the worm needs to reach the top.
- Level
Easy2 of 10
- Topics
- Math, Simulation
- Solved
- No attempts yet
Problem
A worm is at the bottom of a pole. It wants to reach the top, but it is too lazy to climb to the top without stopping. Each time, it can crawl up inches in one go. Right after that, it rests and slides down inches, where is less than . How many times must the worm crawl up to reach the top of the pole?
Input
The input is a single line with three integers , (), and (). They are the number of inches the worm can climb at a time, the number of inches the worm falls while resting, and the height of the pole. The worm is modeled as a point, so it has no length.
Output
Print the number of times the worm must crawl up to reach the top of the pole.