#include <bits/stdc++.h>
//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
using namespace std;
#define sped_up ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
const ll INF = (ll)1e9 + 1, INFL = (ll)1e18 + 1;
const ll mod = (ll)1e9 + 7, MAXN = (ll)1;
int main () {
sped_up;
ll n, m, k;
cin >> n >> m >> k;
map <ll, vector <ll>> mp;
while (k--) {
ll x, y;
cin >> x >> y;
mp[x].push_back(y);
}
ll q;
cin >> q;
while (q--) {
ll x1, y1, x2, y2;
cin >> x1 >> y1 >> x2 >> y2;
while (x1 < x2) {
ll mn = INFL;
for (auto i : mp[x1]) {
if (y1 <= i) {
mn = min(mn, i);
}
}
if (mn == INFL || y1 > y2) break;
y1 = mn;
x1++;
}
if (x1 == x2 && y1 <= y2) cout << "Yes\n";
else cout << "No\n";
}
}
# | 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... |