Pagini recente » Cod sursa (job #1360836) | Cod sursa (job #1512337) | Cod sursa (job #1639209) | Cod sursa (job #1060096) | Cod sursa (job #25481)
Cod sursa(job #25481)
program ograda;
type vect=array[1..500]of word;
var f:text;
x1,y1:vect;
ok:boolean;
n:word;
i,j,m,w,h,x,y,c:longint;
begin
assign(f,'ograzi.in');
reset(f);
readln(f,n,m,w,h);
for i:=1 to n do
begin
readln(f,x,y);
x1[i]:=x;
y1[i]:=y;
end;
for i:=1 to m do
begin
readln(f,x,y);
ok:=false;
j:=0;
repeat
inc(j);
if (x>=x1[j]) and (x<=x1[j]+w)
then if (y>=y1[j]) and (y<=y1[j]+h)
then
begin
ok:=true;
inc(c);
end;
until ok or (j=n);
end;
close(f);
assign(f,'ograzi.out');
rewrite(f);
write(f,c);
close(f);
end.