Cargol
Submit solution
Points:
10
Time limit:
5.0s
Memory limit:
256M
Author:
Problem types
Allowed languages
C#, Go, Java, Python
Un cargol vol trepar un pal d'una alçada de H
metres. Si puja A
metres
durant el dia, però rellisca B
metres avall per la nit, en quin dia
aconseguirà arribar a dalt de tot?
Input Format
Tres números enters positius: H
, A
i B
Constraints
H > B
A > B
Output Format
-
Sample Input 1
6 3 2
Sample Output 1
4
Explanation 1
Sample Input 2
5 3 1
Sample Output 2
2
Explanation 2
Sample Input 3
7 4 3
Sample Output 3
4
Explanation 3
Sample Input 4
6 4 2
Sample Output 4
2
Sample Input 5
9 4 2
Sample Output 5
4
Sample Input 6
13 5 3
Sample Output 6
5
CC BY-NC-SA 4.0