func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mxn = 1003, inf = 1e18 + 18;   int n, m, lcp[mxn][mxn], rk[mxn][mxn], ri[mxn], tot;   long long k, f[mxn];   string s;   struct S {     int l, r;   } a[mxn * mxn];   inline bool cmp(S a, S b) {     int p = a.l + lcp[a.l][b.l], q = b.l + lcp[a.l][b.l];     if (p > a.r or q > b.r) return a.r - a.l < b.r - b.l;     return s[p] < s[q];   }   inline long long add(long long a, long long b) {     return a + b > inf ? inf : a + b;   }   inline long long calc(int md) {     for (int i = 1; i <= n; ++i) {       ri[i] = i;       for (; ri[i] <= n and rk[i][ri[i]] < md;) ++ri[i];     }     memset(f, 0, sizeof(f)), f[n + 1] = 1;     for (int i = 1; i <= m; ++i) {       for (int j = n; j; --j) f[j] = add(f[j], f[j + 1]);       for (int j = 1; j <= n; ++j) f[j] = ri[j] <= n ? f[ri[j] + 1] : 0;       f[n + 1] = 0;     }     return f[1];   }   int main() {     cin >> n >> m >> k >> s, s =     + s;     for (int i = n; i; --i)       for (int j = n; j; --j)         if (s[i] == s[j]) lcp[i][j] = lcp[i + 1][j + 1] + 1;     for (int i = 1; i <= n; ++i)       for (int j = i; j <= n; ++j) a[++tot] = (S){i, j};     sort(a + 1, a + tot + 1, cmp);     for (int i = 1; i <= tot; ++i) rk[a[i].l][a[i].r] = i;     int l = 1, r = tot, md;     for (; l <= r;) {       md = l + r >> 1;       if (calc(md) >= k)         l = md + 1;       else         r = md - 1;     }     for (int i = a[r].l; i <= a[r].r; ++i) putchar(s[i]);   }   