#P5863. [SEERC 2018] Numbers
[SEERC 2018] Numbers
Description
A palindromic number is an integer that reads the same when written normally and when written in reverse. For example, the numbers and are palindromic, but the numbers and are not. You want to decompose a number into a sum of two palindromic numbers. Please compute the number of ways to decompose it in this form.
Input Format
Only one line contains an integer .
Output Format
Output an integer representing the number of ways to decompose as the sum of two palindromic numbers.
156
4
9524
4
42657
6
5735832847451
28
Hint
In the first sample, the decompositions are: .
In the second sample, the decompositions are: .
In the third sample, the decompositions are: $(33, 42624), (333, 42324), (4884, 37773), (37773, 4884), (42324, 333), (42624, 33)$.
Translated by ChatGPT 5
京公网安备 11011102002149号