COCI '10 Contest 2 #1 Puž

View as PDF

Submit solution


Points: 3 (partial)
Time limit: 0.1s
Memory limit: 32M

Problem types

There is a snail on the ground. It wants to climb to the top of a wooden pole with a height of V meters, measuring from the ground level. In one day it can climb A meters upwards, however during each night it sleeps, sliding B meters back down. Determine the number of days it needs to climb to the top.

Input Specification

The first and only line of input contains three integers separated by a single space: A, B, and V (1 \le B < A \le V \le 1\,000\,000\,000), with meanings described above.

Output Specification

The first and only line of output must contain the number of days that the snail needs to reach the top.

Sample Input 1

2 1 5

Sample Output 1

4

Sample Input 2

5 1 6

Sample Output 2

2

Sample Input 3

100 99 1000000000

Sample Output 3

999999901

Comments

There are no comments at the moment.