[ABC213F] 公共前缀之和 (Common Prefixes)
Score : points
Problem Statement
Let the similarity between two strings and be the length of their longest common prefix.
For example, the similarity between abc and axbc is , and the similarity between aaa and aaaa is .
You are given a string of length . Let be the suffix of beginning with the -th character of . For each , find .
Constraints
-
-
is a string of length consisting of lowercase English letters.
Input
Input is given from Standard Input in the following format:
$N$
$S$
Output
Print lines.
The -th line should contain the answer for .
Sample Input 1
3
abb
Sample Output 1
3
3
2
is abb, is bb, and is b.
-
For : .
-
For : .
-
For : .
Sample Input 2
11
mississippi
Sample Output 2
11
16
14
12
13
11
9
7
4
3
4