https://www.luogu.com.cn/problem/P1830
代码:
#include <bits/stdc++.h>
using namespace std;
#define MAXN 204
long long a[MAXN][MAXN];
long long b[MAXN][MAXN];
int main()
{
int m,n,x,y,i,j,tmp;
int x1,y1,x2,y2;
cin>>n>>m>>x>>y;
tmp=x;
while(tmp--)
{
cin>>x1>>y1>>x2>>y2;
for(i=x1; i<=x2; i++)
{
for(j=y1; j<=y2; j++)
{
a[i][j]++;
b[i][j]=x-tmp;
}
}
}
while(y--)
{
cin>>i>>j;
if(a[i][j]!=0)
{
cout<<"Y"<<" "<<a[i][j]<<" "<<b[i][j]<<endl;
}else
{
cout<<"N"<<endl;
}
}
return 0;
}