atcoder#ABC213F. [ABC213F] Common Prefixes
[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:
Output
Print lines.
The -th line should contain the answer for .
3
abb
3
3
2
is abb
, is bb
, and is b
.
- For : .
- For : .
- For : .
11
mississippi
11
16
14
12
13
11
9
7
4
3
4