Physics Experiment
InterviewTime limit1sMemory limit1024 MB
Round a given integer zero or more times to any place to maximize its value, and print the maximum reachable result.
- Level
Medium4 of 10
- Topics
- Greedy, Math, Implementation, String
- Solved
- No attempts yet
Problem
Yunee is taking a physics lab class. One day, after finishing an experiment, Yunee noticed that some figures in the experiment result came out lower than expected. So Yunee decided to manipulate the result by rounding the values several times.
When rounding a number to the -th place, it is rounded down if the digit one place right of the -th place is less than . Otherwise, it is rounded up. For example, rounding to the nearest tens gives . On the other hand, rounding to the nearest hundreds gives .
By rounding to the nearest hundreds and then to the nearest thousands, we get . This is the maximum value we can get by rounding zero or more times.
Help Yunee maximize the value in the experiment result by rounding it zero or more times.
Input
The first line contains an integer representing the value in the experiment result . Note that may exceed the 32-bit integer limit.
Output
Output the maximized value obtained by rounding zero or more times. The output should not have leading zeros.