atcoder#ARC142A. [ARC142A] Reverse and Minimize
[ARC142A] Reverse and Minimize
Score : points
Problem Statement
For a positive integer , let be the answer to the question below.
The following operation on can be performed zero or more times.
- Let be the integer obtained by reversing the decimal notation of . Then, replace with . If now has one or more leading zeros, delete them so that it begins with a non-zero digit.
For example, from , you get after one operation, after two operations, and after three operations. Find the minimum possible value of after operations.
Find the number of integers such that and .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
1420 142
3
Three integers , , and satisfy and .
1419 142
2
6 19
0