func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, z[100005], a[100005], ans[100005];   string s;   int main() {     int i, l = 0, r = 0;     cin >> s;     n = s.length();     memset(z, 0, sizeof(z));     memset(ans, 0, sizeof(ans));     ans[1] = 1;     for (i = 1; i < n; i++) {       if (i <= r) z[i] = min(z[i - l], r - i + 1);       while (i + z[i] < n && s[i + z[i]] == s[z[i]]) z[i]++;       if (i + z[i] - 1 > r) r = i + z[i] - 1, l = i;       ans[1]++;       ans[z[i] + 1]--;     }     for (i = 1; i <= n; i++) ans[i] += ans[i - 1];     a[0] = 0;     for (i = 1; i <= n; i++)       if (z[n - i] == i) a[++a[0]] = i;     a[++a[0]] = n;     printf( %d n , a[0]);     for (i = 1; i <= a[0]; i++) printf( %d %d n , a[i], ans[a[i]]);     return 0;   }   