func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long int mod = 1000000007;   const long long int inf = 0x3f3f3f3f3f3f3f3fLL;   const double eps = 1e-9;   const double PI = acos(-1);   long long int i, j, k;   void solve(void);   inline bool equal(double a, double b) { return fabs(a - b) < eps; }   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     cout << fixed << setprecision(10);     int t = 1;     while (t--) solve();     return 0;   }   void solve() {     int n, a, b, T;     cin >> n >> a >> b >> T;     char c[n];     for (i = (0); i <= (n - 1); ++i) cin >> c[i];     int lo = 1, hi = n, mid, ans = 0, left[n], right[n];     left[0] = right[0] = 1 + (c[0] ==  w  ? b : 0);     for (i = (1); i <= (n - 1); ++i)       left[i] = left[i - 1] + a + (c[n - i] ==  w  ? b : 0) + 1;     for (i = (1); i <= (n - 1); ++i)       right[i] = right[i - 1] + a + (c[i] ==  w  ? b : 0) + 1;     while (lo <= hi) {       mid = (lo + hi) >> 1;       bool pos = 0;       for (i = (mid - 1); i >= (0); --i) {         long long int time1 = right[i] + left[mid - i - 1] - left[0] + i * a;         if (time1 <= T) pos = 1;         long long int time2 = left[i] + right[mid - i - 1] - right[0] + i * a;         if (time2 <= T) pos = 1;       }       if (pos) {         ans = ((ans) > (mid) ? (ans) : (mid));         lo = mid + 1;       } else         hi = mid - 1;     }     cout << ans <<   n ;   }   