#P14027. 【MX-X20-T1】「FAOI-R7」加训加训
【MX-X20-T1】「FAOI-R7」加训加训
Description
Little C is a hard worker who trains every day.
Little C starts with an initial ability value and aims to reach a target ability value . Both and are non-negative integers, and it is guaranteed that . There is a positive integer . Each day, Little C can choose one of the following two training methods:
- Normal training: After training, Little C's ability value becomes .
- Train harder: After training, Little C's ability value becomes .
Little C wants to know: what is the minimum number of days required to make his ability value greater than or equal to ?
Input Format
Only one line containing two non-negative integers , and one positive integer , representing the initial ability value, the target ability value, and the parameter for ability growth, respectively.
Output Format
Output one line containing a positive integer, which is the answer.
2 4 2
1
1 100 3
4
0 5 2
3
1 3 8
1
Hint
Explanation #1
Choose normal training. After training, the ability value becomes , achieving the goal in one day.
Explanation #2
The training plan is as follows:
- On the first day, choose normal training. After training, the ability value becomes .
- On the second day, choose train harder. After training, the ability value becomes .
- On the third day, choose train harder. After training, the ability value becomes .
- On the fourth day, choose train harder. After training, the ability value becomes .
The goal is achieved in four days.
Explanation #3
The training plan is as follows:
- On the first day, choose normal training. After training, the ability value becomes .
- On the second day, choose normal training. After training, the ability value becomes .
- On the third day, choose normal training. After training, the ability value becomes .
The goal is achieved in three days.
Data Range
For of the data, , .
For another of the data, .
For all data, , .
Translated by DeepSeek V3.1
京公网安备 11011102002149号