func_code_string: #include <bits/stdc++.h>   using namespace std;   const int INF = INT_MAX;   const signed long long int LINF = LLONG_MAX;   const double EPS = 1e-9;   const int MOD = 1000000007;   const int MAXN = 100001;   const int ALPH = 26;   const int DALPH = 52;   string s;   vector<int> z;   vector<pair<int, int> > ans;   vector<int> add, sum;   int main() {     cin >> s;     z.resize((int)(s).size());     int l = 0, r = 0;     z[0] = (int)(s).size();     for (int i = 1; i < (int)(s).size(); ++i) {       int j = 0;       if (i <= r) {         int ind = i - l;         j = min(z[ind], r - i + 1);       }       for (; i + j < (int)(s).size(); ++j) {         if (s[j] != s[i + j]) {           break;         }       }       z[i] = j;       if (i + j - 1 > r) {         r = i + j - 1;         l = i;       }     }     add.resize((int)(s).size());     for (int i = 1; i < (int)(s).size(); ++i) {       add[0]++;       add[z[i]]--;     }     sum.resize((int)(s).size());     int cnt = 0;     for (int i = 0; i < (int)(s).size(); ++i) {       cnt += add[i];       sum[i] = cnt + 1;     }     for (int i = (int)(s).size() - 1; i >= 0; --i) {       if (i + z[i] != (int)(s).size()) {         continue;       }       ans.push_back(make_pair((z[i]), (sum[z[i] - 1])));     }     printf( %d n , (int)(ans).size());     for (int i = 0; i < (int)(ans).size(); ++i) {       printf( %d %d n , ans[i].first, ans[i].second);     }   }   