A partition of an integer
To be specific, a palindromic series of integers count the integers as individual characters, so the series 10 + 1 + 10
is a palindrome, and just 21
is also a palindrome.
Given a number
Constraints
Subtask 1 [30%]
Subtask 2 [50%]
Subtask 3 [20%]
Input Specification
One integer
Output Specification
Output the number of different palindromic partitions.
Sample Input
Copy
7
Sample Output
Copy
8
Explanation of Sample
The palindromic partitions of
Copy
7 = 7
7 = 1 + 5 + 1
7 = 2 + 3 + 2
7 = 3 + 1 + 3
7 = 1 + 1 + 3 + 1 + 1
7 = 2 + 1 + 1 + 1 + 2
7 = 1 + 2 + 1 + 2 + 1
7 = 1 + 1 + 1 + 1 + 1 + 1 + 1
In total, there are 8 palindromic partitions.
Comments