mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
1d53c6ce3d
4000-4099
36 lines
665 B
C++
36 lines
665 B
C++
#include"stdio.h"
|
|
#include"string.h"
|
|
#define N 10002
|
|
struct node
|
|
{
|
|
int x,y;
|
|
}A[N];
|
|
int main()
|
|
{
|
|
int i,j,k;
|
|
int n,m;
|
|
int s,d,x,y;
|
|
while(scanf("%d%d",&n,&m),n||m)
|
|
{
|
|
for(i=0;i<n;i++)
|
|
{
|
|
scanf("%d%d",&s,&d);
|
|
scanf("%d%d",&x,&y);
|
|
A[i].x=x;
|
|
A[i].y=x+y;
|
|
}
|
|
for(i=0;i<m;i++)
|
|
{
|
|
scanf("%d%d",&x,&y);
|
|
y=x+y;
|
|
for(k=0,j=0;j<n;j++)
|
|
{
|
|
if(A[j].y>x&&A[j].x<y)
|
|
k++;
|
|
}
|
|
printf("%d\n",k);
|
|
}
|
|
}
|
|
return 0;
|
|
}
|