6605: AtCoder Library Practice Contest —— I - Number of Substrings
[Creator : ]
Description
You are given a string of length $N$. Calculate the number of distinct substrings of $S$.
Input
Input is given from Standard Input in the following format:
$S$
$S$
Output
Print the answer.
Constraints
$1≤N≤500,000$
$S$ consists of lowercase English letters.
$S$ consists of lowercase English letters.
Sample 1 Input
abcbcba
Sample 1 Output
21
Sample 2 Input
mississippi
Sample 2 Output
53
Sample 3 Input
ababacaca
Sample 3 Output
33
aaaaa
5