代码实现
#include <bits/stdc++.h>
using namespace std;
int n, m, x, y;
int x1[10000], y11[10000], x2[10000], y2[10000];
int main()
{
cin >> n >> m >> x >> y;
for (int i = 0; i < x; i++)
{
//注意用了万能头文件后不能定义y1
cin >> x1[i] >> y11[i] >> x2[i] >> y2[i];
}
int a,b;
for (int i = 0; i < y; i++)
{
cin >> a >> b;
int count = 0;
int last = 0;
for (int j = 0; j < x; j++)
{
if (a >= x1[j] && a<=x2[j] && b>=y11[j] && b <= y2[j])
{
count++;
last = j;
}
}
if (count)
{
cout << "Y " << count << " " << last+1 << endl;
}
else {
cout << "N" << endl;
}
}
return 0;
}