Pagini recente » Cod sursa (job #1074771) | Cod sursa (job #1140807) | Cod sursa (job #625238) | Cod sursa (job #1108224) | Cod sursa (job #26797)
Cod sursa(job #26797)
const maxn=1000000;
type sor=array[0..maxn] of byte;
var X,y:sor;
t:text;
N,M,W,H:longint;
I,j,k,xp,yp:longint;
HANY:longint;
procedure bef(bal,jobb:longint; var W:sor);
var e:longint;
begin
for e:=bal to jobb do w[e]:=1;
end;
begin
assign(t,'ograzi.in');
reset(T);
read(t,N,M,W,H);
for i:=0 to maxn do x[i]:=0;
for i:=0 to maxn do y[i]:=0;
for i:=1 to n do begin
read(t,xp);
read(t,yp);
bef(xp,xp+w,x);
bef(yp,yp+H,y);
end;
hany:=0;
for i:=1 to m do begin
read(t,xp,yp);
if y[yp]=1 then
if x[xp]=1 then
inc(hany);
end;
close(T);
assign(t,'ograzi.out');
rewrite(T);
writeln(t,hany);
close(T);
end.