func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long mod = 1000000007;   int n, k;   long long dp[2005][2005][2];   string s;   int main() {     cin >> n >> k >> s;     dp[n][0][0] = 1;     dp[n][0][1] = 1;     for (int i = n - 1; i >= 0; --i) {       for (int j = 0; j <= k; ++j) {         for (int eq = 0; eq <= 1; ++eq) {           dp[i][j][eq] = (dp[i][j][eq] + dp[i + 1][j][1]) % mod;           dp[i][j][eq] =               (dp[i][j][eq] + (dp[i + 1][j][0] * (s[i] -  a ) % mod)) % mod;           if (!eq) {             int till = -1;             for (int a = 0; i + a < n; ++a) {               if (j >= ((a + 1) * (n - (i + a)))) {                 dp[i][j][eq] += dp[i + a + 1][j - ((a + 1) * (n - (i + a)))][0] *                                 ( z  - s[a + i]);                 dp[i][j][eq] %= mod;                 till = a + 1;               } else {                 break;               }             }             if (till == -1) till = 0;             for (int a = n - 1 - i; a >= till; --a) {               if (j >= ((a + 1) * (n - (i + a)))) {                 dp[i][j][eq] += dp[i + a + 1][j - ((a + 1) * (n - (i + a)))][0] *                                 ( z  - s[a + i]);                 dp[i][j][eq] %= mod;               } else                 break;             }           }         }       }     }     cout << dp[0][k][0] <<   n ;     return 0;   }   