func_code_string: #include <bits/stdc++.h>   using namespace std;   const int N = 2e6;   int cost[N], n, a, b, T;   string s;   long long l[N], r[N];   bool check(int d) {     --d;     long long bst = min(l[d], r[d]);     for (int i = 1; i < d; ++i) {       bst = min(bst, l[i] + r[d - i] + a * i);       bst = min(bst, r[i] + l[d - i] + a * i);     }     return bst + d + 1 + cost[0] <= T;   }   int main() {     ios_base::sync_with_stdio(0);     cin >> n >> a >> b >> T;     cin >> s;     for (int i = 0; i < s.size(); ++i) {       cost[i] = (s[i] ==  w  ? b : 0);     }     for (int i = 1; i < n; ++i) {       r[i] = r[i - 1] + cost[i] + a;     }     for (int i = 1; i < n; ++i) {       l[i] = l[i - 1] + cost[n - i] + a;     }     int L = 0, R = n + 1;     while (R - L > 1) {       int m = (L + R) >> 1;       if (check(m))         L = m;       else         R = m;     }     cout << L;     return 0;   }   