Cod sursa(job #388665)

Utilizator Diana_M08Miholca Diana-Lucia Diana_M08 Data 30 ianuarie 2010 18:18:34
Problema Zoo Scor 30
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.58 kb
Program Zoo;
type sir=array[1..16000] of longint;
var f,g:text;
    x,y:sir;
    n,i:integer;
    m,j,x1,y1,x2,y2,nr:longint;
begin
  assign(f,'zoo.in');reset(f);
  assign(g,'zoo.out');rewrite(g);
  Readln(f,n);
  For i:=1 to n do readln(f,x[i],y[i]);
  Readln(f,m);
  For j:=1 to m do begin
                   read(f,x1,y1,x2,y2);
                   nr:=0;
                   For i:=1 to n do
                       If (x[i]>=x1) and (y[i]>=y1) and (x[i]<=x2) and (y[i]<=y2) then inc(nr);
                   writeln(g,nr);
                   end;
 close(f);
 close(g);
end.