func_code_string: #include <bits/stdc++.h>   using namespace std;   long long v[2][200005];   long long c[2][200005];   int n, k, a, b, q, e, day, ord;   const int maxn = 200005;   void add(int i, int value, int z) {     for (; i < maxn; i += (i + 1) & -(i + 1)) v[z][i] += value;   }   long long get(int i, int z) {     long long res = 0;     for (; i >= 0; i -= (i + 1) & -(i + 1)) res += v[z][i];     return res;   }   long long g = 0;   int main() {     scanf( %d%d%d%d%d , &n, &k, &a, &b, &q);     while (q--) {       scanf( %d , &e);       if (e == 1) {         scanf( %d %d , &day, &ord);         long long ord1 = ord, ord2 = ord;         if (c[0][day] <= b) {           long long need = (long long)b - c[0][day];           if (need <= ord1) {             ord1 = need;             c[0][day] = b;           } else             c[0][day] += (long long)ord1;           add(day, ord1, 0);         }         if (c[1][day] <= a) {           long long need = (long long)a - c[1][day];           if (need <= ord2) {             ord2 = need;             c[1][day] = a;           } else             c[1][day] += ord2;           add(day, ord2, 1);         }       } else {         scanf( %d , &day);         g = 0;         if (day - 1) g = get(day - 1, 0);         g += (long long)(get(200004, 1) - get(day + k - 1, 1));         printf( %I64d n , g);       }     }   }   