Blocks of string
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The Block of the string at position is the largest substring that starts at position and matches a prefix of . The length of the block at position is considered to be zero.
Find the lengths of the blocks of string for all positions.
Input
One string .
Output
Print a single line containing the lengths of the blocks of string for all positions.
Examples
Input #1
Answer #1
Submissions 1K
Acceptance rate 24%