Score : 800 points
For a positive integer n, we denote the integer obtained by reversing the decimal notation of n (without leading zeroes) by rev(n). For example, rev(123) = 321 and rev(4000) = 4.
You are given a positive integer D. How many positive integers N satisfy rev(N) = N + D?
Input is given from Standard Input in the following format:
D
Print the number of the positive integers N such that rev(N) = N + D.
63
2
There are two positive integers N such that rev(N) = N + 63: N = 18 and 29.
75
0
There are no positive integers N such that rev(N) = N + 75.
864197532
1920