func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, k;   string s;   long long md = 1000000007;   int a[2100];   long long dp[2100][2100];   long long sdp[2100][2100];   int main() {     cin >> n >> k >> s;     for (int i = 0; i < n; i++) a[i] = s[i] -  a ;     dp[n][0] = 1;     sdp[n][0] = 1;     for (int i = n - 1; i >= 0; i--) {       for (int j = 0; j <= k; j++) {         sdp[i][j] = (dp[i + 1][j]) * ((long long)(a[i]));         sdp[i][j] += sdp[i + 1][j];         sdp[i][j] %= md;         int ll = i;         for (int l = i; (l < n) && ((l - i + 1) * (n - l) <= j); l++, ll++) {           dp[i][j] = (dp[i][j] + ((long long)(25 - a[l])) *                                      dp[l + 1][j - (l - i + 1) * (n - l)]) %                      md;         }         for (int l = n - 1; (l >= ll) && ((l - i + 1) * (n - l) <= j); l--) {           dp[i][j] = (dp[i][j] + ((long long)(25 - a[l])) *                                      dp[l + 1][j - (l - i + 1) * (n - l)]) %                      md;         }         dp[i][j] += sdp[i][j];         dp[i][j] %= md;       }     }     cout << dp[0][k] << endl;     return 0;   }   