Given a string s, find the number of ways to split s to substrings such that if there are kkk substrings in partition, then pi=pki+1p_i=p_{k-i+1}pi=pki+1 for all ii i and kkk is even. Since the number of ways can be large, print it modulo 109+710^9+7109+7.
Given a string s, find the number of ways to split s to substrings such that if there are kkk substrings (p1, p2, p3, ..., pk)(p_1, p_2, p_3, ..., p_k)(p1, p2, p3, ..., pk) in partition, then pi = pk − i + 1p_i = p_{k - i + 1}pi = pk − i + 1 for all i(1 ≤ i ≤ k)i (1 ≤ i ≤ k)i(1 ≤ i ≤ k) and kkk is even. Since the number of ways can be large, print it modulo 109 + 710^9 + 7109 + 7.
(图片来源网络,侵删)