func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, a, b, k, q;   int added[200055];   struct BIT {     int dat[200055];     void add(int id, int val) {       while (id < n) {         dat[id] += val;         id |= (id + 1);       }     }     int sum(int id) {       int ret = 0;       while (id >= 0) {         ret += dat[id];         id = (id & (id + 1)) - 1;       }       return ret;     }   } B1, B2;   int main() {     ios::sync_with_stdio(false);     cin.tie(0);     cin >> n >> k >> a >> b >> q;     int ope, x, y;     while (q--) {       cin >> ope;       if (ope == 1) {         cin >> x >> y;         x--;         if (added[x] < b) {           B2.add(x, min(y, b - added[x]));         }         if (added[x] < a) {           B1.add(x, min(y, a - added[x]));           added[x] = min(a, added[x] + y);         }       } else {         cin >> x;         x--;         y = x + k - 1;         cout << B1.sum(n - 1) - B1.sum(y) + B2.sum(x - 1) <<   n ;       }     }     return 0;   }   