Cod sursa(job #25015)
Utilizator | Habalau Andrei darklord | Data | 4 martie 2007 09:41:50 |
---|---|---|---|
Problema | Ograzi | Scor | 30 |
Compilator | cpp | Status | done |
Runda | preONI 2007, Runda 3, Clasele 11-12 | Marime | 0.51 kb |
#include <stdio.h>
#define dim 50001
struct dr
{ long x,y;
}a[dim];
long x,y,n,m,w,h,i,j,s;
int main ()
{ freopen ("ograzi.in","r",stdin);
freopen ("ograzi.out","w",stdout);
scanf("%ld%ld%ld%ld",&n,&m,&w,&h);
for(i=0;i<n;++i)
{ scanf("%ld%ld",&x,&y);
a[i].x=x;
a[i].y=y;
}
for(i=0;i<m;++i)
{ scanf("%ld%ld",&x,&y);
for(j=0;j<n;++j)
{ if(x>=a[j].x&&y>=a[j].y)
if(x<=(a[j].x+w)&&y<=(a[j].y+h))
{ ++s;
break;
}
}
}
printf("%ld",s);
return 0;
}