func_code_string: #include <bits/stdc++.h>   using namespace std;   const int MM = 2e5 + 5;   int n, k, a, b, q, pref[MM], suff[MM], cnt[MM];   void upd(int bit[], int x, int v) {     for (; x < MM; x += x & -x) {       bit[x] += v;     }   }   int get(int bit[], int x) {     int res = 0;     for (; x > 0; x -= x & -x) res += bit[x];     return res;   }   int get(int bit[], int l, int r) { return get(bit, r) - get(bit, l - 1); }   int main() {     cin.tie(0)->sync_with_stdio(0);     cin >> n >> k >> a >> b >> q;     while (q--) {       int t;       cin >> t;       if (t == 1) {         int x, v;         cin >> x >> v;         int val = min(b, v + cnt[x]);         int diff = val - get(pref, x, x);         upd(pref, x, diff);         val = min(a, v + cnt[x]);         diff = val - get(suff, x, x);         upd(suff, x, diff);         cnt[x] += v;       } else {         int p;         cin >> p;         int ans = get(pref, p - 1);         ans += get(suff, p + k, MM - 1);         cout << ans <<   n ;       }     }   }   