Round a positive integer up to the nearest multiple of 10, then repeatedly apply the same rule until it stops changing.
You are given a positive integer . In one move, you may replace the number by the result of rounding it up to the nearest multiple of 10.
This means:
- if the last digit is already
0, the number stays the same; - otherwise, increase it just enough to make the last digit
0.
Keep applying this operation while the number changes. Return the final value after it becomes stable.
For example, , so the answer is $30$.
Task
Compute the final stable value produced by this repeated rounding process.
Input Format
- The first line contains one integer .
Output Format
- Print one integer: the final value after the repeated rounding process stabilizes.
Constraints
Example 1
Input
27
Output
30
Explanation
27 rounds up to 30. Since 30 already ends in 0, the process stops.
Example 2
Input
40
Output
40
Explanation
40 already ends in 0, so it is unchanged.
Premium problem context
Unlock deeper context for this problem
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.