func_code_string: #include <bits/stdc++.h>   using namespace std;   const int maxn = 2e5 + 10;   int ans[maxn];   vector<int> xs[maxn], ys[maxn];   struct query {     int l, r, d, u, id;     query(int aa, int bb, int cc, int dd, int ee) {       l = aa;       r = bb;       d = cc;       u = dd;       id = ee;     }     query() {}   };   query qry[maxn];   vector<int> xq[maxn], yq[maxn];   struct SegmentTree {     SegmentTree *lc, *rc;     static SegmentTree mem[2000000];     static SegmentTree *ptr;     int pos;     SegmentTree() {}     ~SegmentTree() {}     SegmentTree(int L, int R) {       lc = rc = nullptr;       pos = 0;       if (L == R) return;       lc = new (ptr++) SegmentTree(L, ((L + R) >> 1));       rc = new SegmentTree(((L + R) >> 1) + 1, R);     }     void pull() { pos = min(lc->pos, rc->pos); }     void modify(int L, int R, int x, int v) {       if (L == R) {         pos = v;         return;       }       if (x <= ((L + R) >> 1))         lc->modify(L, ((L + R) >> 1), x, v);       else         rc->modify(((L + R) >> 1) + 1, R, x, v);       pull();     }     int ask(int L, int R, int l, int r) {       if (L > r || l > R) return maxn;       if (L >= l && R <= r) return pos;       return min(lc->ask(L, ((L + R) >> 1), l, r),                  rc->ask(((L + R) >> 1) + 1, R, l, r));     }   } * stx, *sty;   SegmentTree SegmentTree::mem[2000000];   SegmentTree *SegmentTree::ptr = mem;   int main() {     ios_base::sync_with_stdio(false);     cin.tie(0);     int n, m, k, q;     cin >> n >> m >> k >> q;     for (int i = 0; i < k; ++i) {       int x, y;       cin >> x >> y;       xs[x].push_back(y);       ys[y].push_back(x);     }     for (int i = 0; i < q; ++i) {       int x1, y1, x2, y2;       cin >> x1 >> y1 >> x2 >> y2;       qry[i] = query(x1, x2, y1, y2, i);       xq[x2].push_back(i);       yq[y2].push_back(i);     }     stx = new (SegmentTree::ptr++) SegmentTree(0, maxn - 1);     sty = new (SegmentTree::ptr++) SegmentTree(0, maxn - 1);     for (int i = 0; i < maxn; ++i)       if (xs[i].size() || xq[i].size()) {         for (int j : xs[i]) stx->modify(0, maxn - 1, j, i);         for (int j : xq[i]) {           if (stx->ask(0, maxn - 1, qry[j].d, qry[j].u) < qry[j].l) ++ans[j];         }       }     for (int i = 0; i < maxn; ++i)       if (ys[i].size() || yq[i].size()) {         for (int j : ys[i]) sty->modify(0, maxn - 1, j, i);         for (int j : yq[i]) {           if (sty->ask(0, maxn - 1, qry[j].l, qry[j].r) < qry[j].d) ++ans[j];         }       }     for (int i = 0; i < q; ++i) {       if (ans[i] == 2)         cout <<  NO  << endl;       else         cout <<  YES  << endl;     }     return 0;   }   