atcoder#ABC234E. [ABC234E] Arithmetic Number
[ABC234E] Arithmetic Number
Score : points
Problem Statement
Let us call a positive integer that satisfies the following condition an arithmetic number.
- Let be the -th digit of from the top (when is written in base without unnecessary leading zeros.) Then, holds, where is the number of digits in .- This condition can be rephrased into the sequence being arithmetic.
- If is a -digit integer, it is assumed to be an arithmetic number.
For example, are arithmetic numbers, while are not.
Find the smallest arithmetic number not less than .
Constraints
- is an integer between and (inclusive).
Input
Input is given from Standard Input in the following format:
Output
Print the answer as an integer.
152
159
The smallest arithmetic number not less than is .
88
88
itself may be an arithmetic number.
8989898989
9876543210