#CCBCHMOT0000002. Lặp đến khi đạt 100 (Reach One Hundred)
Lặp đến khi đạt 100 (Reach One Hundred)
Reach One Hundred
Source: Phước Hưng OJ
Version: Phuoc Hung OJ Extended
Problem Statement
Starting with integer x, an operation increases it by exactly 7. Find the minimum number of operations needed to make x at least 100. If x is already 100, the answer is zero.
Input
One integer x, the initial value.
Output
Print the nonnegative minimum number of +7 operations.
Subtasks
- Subtask 1 (20%): 93 <= x <= 100.
- Subtask 2 (30%): 50 <= x <= 100.
- Subtask 3 (50%): 0 <= x <= 100.
Examples
Example 1
Input
99
Output
1
Explanation
99 is below 100. One addition gives 106, which reaches the target.
Example 2
Input
100
Output
0
Explanation
100 already meets the target; no operations are needed.
Example 3
Input
0
Output
15
Explanation
After 14 steps x=98; the 15th gives 105.