#Lutece1575. Hesty Str1ng Again
Hesty Str1ng Again
Migrated from Lutece 1575 Hesty Str1ng 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
A Palindrome string is a string which reads the same backward as forward, such as or
There is a problem about the palindrome string again.
You are given a pattern string with the length . For another string , we can define its similarity with by
$$Sim(T, S) = |\{(i,~j)~|~1 \leq i \leq j \leq N~\mathrm{and}~(T~+~S_{i \dots j})~\mathrm{is~a~palindrome~string}\}|, $$where "'' denotes the substring of from the position to and "'' means the string concatenate operation.
Now, for a given string with the length , you need to calculate all its prefixes' similarity with , i.e., calculate
$Sim(T_{1 \dots 1}, S), Sim(T_{1 \dots 2}, S), \dots, Sim(T_{1 \dots M}, S)$.
Input
The first line contains a string .
The second line contains a sting .
, both and are composed by lowercase English characters.
Output
Print lines, for the line, print .
Samples
aaba
aba
3
2
0
2
Resources
The 15th UESTC Programming Contest Final