Once a man is bent, someone else will ride on your back, and what you do should be straight forward.Although you go slowly, you never go back.Never underestimate your power.Get to the point.
You have a string s,where len is the length of string s, and si its i-th character.The prefix is s[0..i] (0 ≤ i < len). The suffix is s[i..len-1] (0 ≤ i < len).
Your task is, for any prefix of string s which matches a suffix of string s, print the number of times it occurs in string s as a substring.( Including the original string s.)