func_code_string: #include <bits/stdc++.h>   using namespace std;   std::mt19937 rnd(       (int)std::chrono::steady_clock::now().time_since_epoch().count());   long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }   const int MAXH = 200000;   const int MAXW = 200000;   const int MAXQ = 200000;   int h, w, nq;   int qx[MAXQ], qy[MAXQ];   bool qans[MAXQ];   int a[MAXW], b[MAXW];   bool can(int cnt) {     for (int y = (0); y < (w); ++y) a[y] = b[y] = 0;     for (int i = (0); i < (cnt); ++i) {       int x = qx[i], y = qy[i];       if (x % 2 == 1 && y % 2 == 1) {         x /= 2, y /= 2;         a[y] = max(a[y], x + 1);       } else {         assert(x % 2 == 0 && y % 2 == 0);         x /= 2, y /= 2;         b[y] = max(b[y], h - x);       }     }     for (int y = w - 2; y >= 0; --y) a[y] = max(a[y], a[y + 1]);     for (int y = 2; y < w; ++y) b[y] = max(b[y], b[y - 1]);     for (int y = (0); y < (w); ++y)       if (a[y] + b[y] > h) return false;     return true;   }   void solve() {     int lo = 0, hi = nq + 1;     while (lo + 1 < hi) {       int mi = lo + (hi - lo) / 2;       if (can(mi))         lo = mi;       else         hi = mi;     }     int res = lo;     for (int i = (0); i < (nq); ++i)       if (i + 1 <= res)         qans[i] = true;       else         qans[i] = false;   }   void run() {     scanf( %d%d%d , &h, &w, &nq);     for (int i = (0); i < (nq); ++i)       scanf( %d%d , &qx[i], &qy[i]), --qx[i], --qy[i];     solve();     for (int i = (0); i < (nq); ++i) printf( %s n , qans[i] ?  YES  :  NO );   }   int main() {     run();     return 0;   }   