Pagini recente » Cod sursa (job #1399961) | Cod sursa (job #1116857) | Cod sursa (job #2445687) | Cod sursa (job #398962) | Cod sursa (job #25694)
Cod sursa(job #25694)
type punct=record
x1,y1,x2,y2:longint;
end;
var n,m,w,h,i,j,x,y,nr:longint;
f:text;
v:array[1..100000] of punct;
ok:boolean;
procedure citire;
begin
assign(f,'ograzi.in');reset(f);
readln(f,n,m,w,h);
for i:=1 to n do begin
readln(f,v[i].x1,v[i].y1);
v[i].x2:=v[i].x1+w;
v[i].y2:=v[i].y1+h;
end;
for i:=1 to m do begin
ok:=false;j:=1;
readln(f,x,y);
while(j<=n)and(not ok) do begin
if (x<=v[j].x2)and(x>=v[j].x1)and
(y<=v[j].y2)and(y>=v[j].y1) then
nr:=nr+1;
j:=j+1;
end;
end;
close(f);
end;
begin
nr:=0;
citire;
assign(f,'ograzi.out');rewrite(f);
writeln(f,nr);
close(f);
end.