| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 1024 MB | 71 | 14 | 12 | 25.000% |
Consider the segment of non-negative integers from $l$ to $r$. Write them in a row in decimal notation, getting a string $a$. For example, if $l=3$ and $r=10,ドル $a=345678910$.
You have to find such segment of consecutive non-negative integers $[l,r]$ (0ドル \le l \le r \le 10^{18}$) that the length of the string $a,ドル corresponding to this segment, is exactly $S,ドル and the number of integers in the segment $[l,r]$ is maximum possible.
The only line contains one integer $S$ (1ドル \le S \le 10^{18}$).
Print the length of the optimal segment $[l,r]$ in the first line. If there is no solution, print $-1$.
If the solution exists, print two integers $l$ and $r$ in the second line.
If there are multiple optimal solutions, print any of them.
3
3 0 2
10
10 0 9
20
15 0 14