0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 20:56:37 +00:00
OI-codes/Luogu/P1830/P1830.cpp

29 lines
683 B
C++
Raw Normal View History

2021-06-30 09:34:00 +00:00
#include <bits/stdc++.h>
using namespace std;
pair<int, int> boom[105][105];
int main() {
int n, m, x, y, x1, y1, x2, y2;
cin >> n >> m >> x >> y;
for (int i = 1; i <= x; i++) {
cin >> x1 >> y1 >> x2 >> y2;
for (int j = x1; j <= x2; j++) {
for (int k = y1; k <= y2; k++) {
boom[j][k].first++;
boom[j][k].second = i;
}
}
}
for (int i = 1; i <= y; i++) {
cin >> x1 >> y1;
if (boom[x1][y1].first) {
cout << "Y " << boom[x1][y1].first << ' ' << boom[x1][y1].second << endl;
} else {
cout << "N" << endl;
}
}
return 0;
}