func_code_string: #include <bits/stdc++.h>   using namespace std;   int n;   long long a, b, T;   char s[500010];   long long pref[500010];   long long suff[500010];   int main() {     cin >> n >> a >> b >> T;     for (int i = 1; i <= n; ++i) {       cin >> s[i];     }     pref[1] = 0;     for (int i = 2; i <= n; ++i) {       pref[i] = a + pref[i - 1] + 1;       if (s[i] ==  w ) {         pref[i] += b;       }     }     suff[n + 1] = 0;     for (int i = n; i >= 2; --i) {       suff[i] = a + 1 + suff[i + 1];       if (s[i] ==  w ) {         suff[i] += b;       }     }     int ans = 0;     long long t = 1;     if (s[1] ==  w ) {       t += b;     }     if (T < t) {       cout << 0;       return 0;     }     T -= t;     ++ans;     for (int i = 2; i <= n; ++i) {       if (pref[i] > T) {         break;       }       ans = max(ans, i);       long long t = T - pref[i] - (i - 1) * a;       if (t < 0) {         continue;       }       int l = i;       int r = n + 1;       while (l + 1 < r) {         int m = (l + r) / 2;         if (suff[m] <= t) {           r = m;         } else {           l = m;         }       }       ans = max(ans, i + n + 1 - r);     }     for (int i = n; i >= 2; --i) {       if (suff[i] > T) {         break;       }       ans = max(n - i + 2, ans);       long long t = T - suff[i] - (n + 1 - i) * a;       if (t < 0) {         continue;       }       int l = 1, r = i;       while (l + 1 < r) {         int m = (l + r) / 2;         if (pref[m] <= t) {           l = m;         } else {           r = m;         }       }       ans = max(ans, n - i + 1 + l);     }     cout << ans;     return 0;   }   