Problem D
99 Problems
Ingrid is the founder of a company that sells bicycle parts. She used to set the prices of products quite arbitrarily, but now she has decided that it would be more profitable if the prices end in $99$.
You are given a positive integer $N$, the price of a product. Your task is to find the nearest positive integer to $N$ which ends in $99$. If there are two such numbers that are equally close, find the bigger one.
Input
The input contains one integer $N$ ($1 \leq N \leq 10^4$), the price of a product. It is guaranteed that the number $N$ does not end in $99$.
Output
Print one integer, the closest positive integer that ends in $99$. In case of a tie, print the bigger one.
Sample Input 1 | Sample Output 1 |
---|---|
10 |
99 |
Sample Input 2 | Sample Output 2 |
---|---|
249 |
299 |
Sample Input 3 | Sample Output 3 |
---|---|
10000 |
9999 |