func_code_string: #include <bits/stdc++.h>   using namespace std;   int main() {     int n, a, b, T, i, j, temp, le, ri, mid, ma = 0;     cin >> n >> a >> b >> T;     char str[n];     cin >> str;     int r[n], l[n];     if (str[0] ==  h )       r[0] = 1;     else       r[0] = b + 1;     for (i = 1; i < n; i++) {       if (str[i] ==  h )         r[i] = r[i - 1] + a + 1;       else         r[i] = r[i - 1] + a + b + 1;     }     if (str[n - 1] ==  h )       l[0] = a + 1;     else       l[0] = a + b + 1;     for (i = 1; i < n - 1; i++) {       if (str[n - 1 - i] ==  h )         l[i] = l[i - 1] + a + 1;       else         l[i] = l[i - 1] + a + b + 1;     }     for (i = 0; i < n; i++)       if (r[i] <= T) ma = max(ma, i + 1);     for (i = 0; i < n - 1; i++) {       temp = l[i];       if (temp >= T) continue;       le = 0;       ri = n - 1 - i - 1;       while (ri - le > 1) {         mid = (le + ri) / 2;         temp = l[i] + min(i + 1, mid) * a;         if (temp + r[mid] < T)           le = mid;         else           ri = mid;       }       if (l[i] + r[le] + min(i + 1, le) * a <= T) ma = max(ma, i + le + 2);       if (l[i] + r[ri] + min(i + 1, ri) * a <= T) ma = max(ma, i + ri + 2);     }     cout << ma;   }   