#Lutece0606. Palindrome Again
Palindrome Again
Migrated from Lutece 606 Palindrome Again
All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.
Description
Palindrome really has many many properties which fascinated us a lot and arouse many interests.
Do you remember that last summer, the problem about longest palindrome in the inteval?
Too easy? Maybe you are tired of solving problem about palindrome on one string.
Here is your another challenge.
There are two strings, and , and an integer .
And you are to count the number of triples . that satisfies , , , is a palindrome, is the length of the substring,
A substring of a string is defined as:
, .
Input
The input file contains several cases, end by EOF
. For each cases, the first line contains one integer , followed by two lines containing strings and , respectively.
Characters of and are all lowercase letters.
Output
For each case, output an integer indicates the number of the triples .
Samples
1
aba
aba
1
icpc
cicpc
2
myon
usagi
6
9
0
Note
In the first sample , the triples are
respectively.
Resources
6th BUPT Programming Contest Final