Author: | Anton Karabanov | Time limit: | 1 sec | |
Input file: | Standard input | Memory limit: | 512 Mb | |
Output file: | Standard output |
Timofey came up with a new function and named it after himself. Now his name proudly stands besides the name of Euler, Möbius and Riemann — some functions were also named after them. Unfortunately, Timofey hasn't found a practical use case for his discovery yet, but he is actively working on it.
Timofey's function is defined on positive integers as follows: f(x) = x + ⌊ x10⌋ + ⌊ x100⌋ + ⌊ x1000⌋ + …, where ⌊ x10n⌋ is rounding down to an integer. For example, f(404) = 404 + ⌊ 40410⌋ + ⌊ 404100⌋ = 404 + 40 + 4 = 448.
While Timofey is writing a paper for a mathematical journal, find number x such that f(x) = n.
Input contains a positive integer n — function value.
Output a single positive integer — an argument the function has the desired value at. It's guaranteed to be unique.
1 ≤ n ≤ 1018
No. | Standard input | Standard output |
---|---|---|
1 |
|
|