func_code_string: #include <bits/stdc++.h>   using namespace std;   bool debug = 0;   int n, m, k;   int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};   string direc =  RDLU ;   long long ln, lk, lm;   int r, c;   vector<int> v[3105];   multiset<int> ms;   int pos[30];   void fmain() {     scanf( %d%d%d%d , &r, &c, &n, &k);     for (int i = 0, x, y; i < n; i++) {       scanf( %d%d , &x, &y);       v[x].push_back(y);     }     long long ans = 0, cnt = 0;     for (int(i) = 1; (i) <= (int)(r); (i)++) {       ms.clear();       cnt = 0;       for (int(j) = 0; (j) < (int)(k + 1); (j)++) {         ms.insert(0);         ms.insert(c + 1);       }       for (int j = i; j <= r; j++) {         for (int x : v[j]) {           auto it = ms.insert(x), it1 = it;           for (int z = k; z >= 0; z--) {             pos[z] = *it;             it--;           }           it1++;           for (int z = k + 1; z <= k + k; z++) {             pos[z] = *it1;             it1++;           }           for (int z = k; z < k + k; z++) {             cnt += (long long)(pos[z + 1] - pos[z]) *                    (pos[z - (k - 1)] - pos[z - k]);           }         }         ans += cnt;       }     }     printf( %lld n , ans);   }   int main() {     fmain();     return 0;   }   