func_code_string: #include <bits/stdc++.h>   using namespace std;   const long long N = 5000700;   template <typename T>   pair<T, T> operator-(pair<T, T> a, pair<T, T> b) {     return make_pair(a.first - b.first, a.second - b.second);   }   template <typename T>   pair<T, T> operator+(pair<T, T> a, pair<T, T> b) {     return make_pair(a.first + b.first, a.second + b.second);   }   long long ans[N];   long long qx[N];   long long qy[N];   vector<long long> qrs;   bool to_left(const pair<long long, long long> &a,                const pair<long long, long long> &b) {     return a.second * b.first > a.first * b.second;   }   bool to_left_equal(const pair<long long, long long> &a,                      const pair<long long, long long> &b) {     return a.second * b.first >= a.first * b.second;   }   bool in_triangle(const pair<long long, long long> &x,                    const pair<long long, long long> &a,                    const pair<long long, long long> &b,                    const pair<long long, long long> &c) {     bool b1 = to_left_equal(x - a, b - a), b2 = to_left_equal(x - b, c - b),          b3 = to_left_equal(x - c, a - c), b4 = to_left_equal(x - a, c - a),          b5 = to_left_equal(x - b, a - b), b6 = to_left_equal(x - c, b - c);     return ((b1 && b2 && b3) || (b4 && b5 && b6));   }   long long quadrant(const pair<long long, long long> &a) {     if (a.second < 0) {       if (a.first < 0)         return 0;       else         return 1;     } else {       if (a.first > 0)         return 2;       else         return 3;     }   }   bool f(const long long &a, const long long &b) {     if (qx[a] == qx[b] && qy[a] == qy[b]) return false;     if (qx[a] == 0 && qy[a] == 0) return true;     if (qx[b] == 0 && qy[b] == 0) return false;     long long n1 = quadrant(make_pair(qx[a], qy[a])),               n2 = quadrant(make_pair(qx[b], qy[b]));     if (n1 != n2) return n1 < n2;     return to_left(make_pair(qx[b], qy[b]), make_pair(qx[a], qy[a]));   }   bool f2(const pair<long long, long long> &a,           const pair<long long, long long> &b) {     if (a == b) return false;     if (a.first == 0 && a.second == 0) return true;     if (b.first == 0 && b.second == 0) return false;     long long n1 = quadrant(a), n2 = quadrant(b);     if (n1 != n2) return n1 < n2;     return to_left(b, a);   }   vector<pair<long long, long long>> w[5];   vector<pair<long long, long long>> points;   vector<pair<long long, long long>> allPoints;   vector<pair<long long, long long>> half[2];   void sum(vector<pair<long long, long long>> w1,            vector<pair<long long, long long>> w2, long long id) {     points.clear();     allPoints.clear();     half[0].clear();     half[1].clear();     pair<long long, long long> mini1 = w1[0], mini2 = w2[0];     long long mini1it, mini2it;     for (long long i = 0; i < w1.size(); i++) {       if (w1[i].second > mini1.second ||           (w1[i].second == mini1.second && w1[i].first < mini1.first)) {         mini1it = i;         mini1 = w1[i];       }     }     for (long long i = 0; i < w2.size(); i++) {       if (w2[i].second > mini2.second ||           (w2[i].second == mini2.second && w2[i].first < mini2.first)) {         mini2it = i;         mini2 = w2[i];       }     }     for (long long i = 0; i + 1 < w1.size(); i++) {       allPoints.push_back(w1[i + 1] - w1[i]);     }     allPoints.push_back(w1[0] - w1[w1.size() - 1]);     for (long long i = 0; i + 1 < w2.size(); i++) {       allPoints.push_back(w2[i + 1] - w2[i]);     }     allPoints.push_back(w2[0] - w2[w2.size() - 1]);     sort(allPoints.begin(), allPoints.end(), f2);     pair<long long, long long> cp = mini1 + mini2;     for (auto it : allPoints) {       cp = cp + it;       points.push_back(cp);     }     sort(points.begin(), points.end());     vector<pair<long long, long long>> half[2];     for (long long i = 0; i < 2; i++) {       for (auto it : points) {         while (half[i].size() >= 2 &&                to_left_equal(it - half[i][half[i].size() - 2],                              half[i].back() - half[i][half[i].size() - 2]))           half[i].pop_back();         half[i].push_back(it);       }       reverse(points.begin(), points.end());     }     for (auto x : half[0]) {       w[id].push_back(x);     }     for (long long i = 1; i + 1 < half[1].size(); i++)       w[id].push_back(half[1][i]);     reverse(w[id].begin(), w[id].end());   }   void solve() {     for (long long i = 0; i < 3; i++) {       long long n;       cin >> n;       for (long long j = 0; j < n; j++) {         long long x, y;         cin >> x >> y;         w[i].push_back(make_pair(x, y));       }     }     sum(w[0], w[1], 3);     sum(w[2], w[3], 4);     auto mini = w[4][0];     for (auto it : w[4]) {       if (it.second < mini.second ||           (it.second == mini.second && it.first < mini.first))         mini = it;     }     for (auto &it : w[4]) it = it - mini;     sort(w[4].begin(), w[4].end(), f2);     long long q;     cin >> q;     for (long long i = 0; i < q; i++) {       cin >> qx[i] >> qy[i];       qx[i] = 3 * qx[i] - mini.first;       qy[i] = 3 * qy[i] - mini.second;       qrs.push_back(i);     }     long long ptr = 1;     sort(qrs.begin(), qrs.end(), f);     for (long long i = 0; i < q; i++) {       long long query = qrs[i];       if (qy[query] < 0) {         continue;       }       if (qy[query] == 0 && qx[query] == 0) {         ans[query] = 1;         continue;       }       while (ptr + 1 < w[4].size() &&              to_left(make_pair(qx[query], qy[query]), w[4][ptr + 1])) {         ptr++;       }       if (ptr + 1 < w[4].size() &&           in_triangle(make_pair(qx[query], qy[query]), make_pair(0, 0), w[4][ptr],                       w[4][ptr + 1]))         ans[query] = 1;     }     for (long long i = 0; i < q; i++) {       if (ans[i]) {         cout <<  YES n ;       } else {         cout <<  NO n ;       }     }   }   int32_t main() {     long long t = 1;     while (t--) solve();     return 0;   }   