#include "bits/stdc++.h"
using namespace std;
#define int long long
signed main() {
int r, c, n;
cin >> r >> c >> n;
vector <int> a(n);
vector <int> b(n);
for (int i = 0; i < n; i ++) cin >> a[i] >> b[i];
set <pair <int, int>> st;
for (int i = 0; i < n; i ++) st.insert({a[i], b[i]});
int t;
cin >> t;
while (t --) {
int sx, sy, ex, ey;
cin >> sx >> sy >> ex >> ey;
int x = sx, y = sy;
while (x < ex) {
while (st.find({x, y}) == st.end() && y < c) {
y ++;
}
if (st.find({x, y}) != st.end()) x ++;
else break;
}
if (x == ex && y <= ey) cout << "Yes" << endl;
else cout << "No" << endl;
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |