Optimistic as usual, Furina rounds all numbers up to 1 significant digit. Unfortunately for her, Neuvillette requires precise numbers for official documents. Given the precise number as an integer , Neuvillette needs to calculate an adjustment value that must be subtracted from Furina's rounded number.
Since these numbers may be extremely large, mental math would be insufficient.
Seeing your outstanding programming reputation, Neuvillette asks you to compute the adjustment value as previously described.
Formally, calculate the non-negative integer difference between
and the smallest integer greater than or equal to
with exactly one non-zero digit.
Constraints
Subtask 1 [20%]
Subtask 2 [30%]
Subtask 3 [50%]
No additional constraints.
Note: You do not need to pass the last sample to earn points on the first two subtasks.
Sample Input 1
299
Sample Output 1
1
Explanation for Sample 1
Furina rounds to up
. The required adjustment value is
.
Sample Input 2
8
Sample Output 2
0
Explanation for Sample 2
Furina's rounded number is the same. Therefore, no adjustment is needed.
Sample Input 3
60000
Sample Output 3
0
Explanation for Sample 3
Furina's rounded number is the same. Therefore, no adjustment is needed.
Sample Input 4
237862394932878926523237
Sample Output 4
62137605067121073476763
Explanation for Sample 4
Furina rounds to up
. The required adjustment value is
.
Comments