Cod sursa(job #43547)

Utilizator AymdTrimbitas Viorel Stefan Aymd Data 30 martie 2007 11:43:03
Problema Ograzi Scor 10
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.43 kb
var n,m,l,h,a,b,nr,i,j:longint;
    x,y:array[1..50001]of longint;
    g,f:text;

begin
assign(f,'ograzi.in');
reset(f);
readln(f,n,m,l,h);
for i:=1 to n do readln(f,x[i],y[i]);
n:=n+1;
for i:=1 to m do begin
   readln(f,a,b);
   x[n]:=a;
   y[n]:=b;
   j:=1;
   while (a<x[j]){or(b<y[j])or(a-x[j]>l)or(b-y[j]>h)} do j:=j+1;
   if j<n then nr:=nr+1;
end;
assign(g,'ograzi.out');
rewrite(g);
write(g,nr);
close(g);
end.