eolymp
bolt
Try our new interface for solving problems
Problems

The largest block

The largest block

The \textit{Block }of a string \textbf{S} at position \textbf{i} is the largest substring \textbf{S} which starts at position \textbf{i} and matches with the prefix \textbf{S}. The length of the block started at position \textbf{0} is assumed to be zero. Find the length of the largest block for the given string \textbf{S}. \InputFile The only string of \textbf{S} (|\textbf{S}| ≤ \textbf{10^6}). \OutputFile The length of the largest block of string \textbf{S}.
Time limit 1 second
Memory limit 64 MiB
Input example #1
abaabaab
Output example #1
5