func_code_string: #include <bits/stdc++.h>   using namespace std;   vector<int> fail(string s) {     int n = s.size();     vector<int> z(n);     int l = 0, r = 0;     for (int i = 1; i < n; ++i) {       if (i <= r) z[i] = min(z[i - l], r - i + 1);       while (z[i] + i < n && s[z[i] + i] == s[z[i]]) ++z[i];       if (z[i] + i - 1 > r) {         l = i;         r = z[i] + i - 1;       }     }     return z;   }   string s;   vector<int> z;   vector<pair<int, int> > ans;   int A[100005];   int main() {     ios_base::sync_with_stdio(false);     cout.tie(0);     cin.tie(0);     int n, m, i, j, k, x, y;     cin >> s;     z = fail(s);     n = s.size();     z[0] = n;     for (i = 0; i < n; ++i) A[z[i]]++;     for (i = n - 1; i >= 0; --i) A[i] += A[i + 1];     for (i = n - 1; i >= 0; --i) {       if (z[i] == (n - i)) {         ans.push_back(make_pair(z[i], A[z[i]]));       }     }     sort(ans.begin(), ans.end());     cout << ans.size() << endl;     for (auto it : ans) {       cout << it.first <<     << it.second << endl;     }     return 0;   }   