Cod sursa(job #25208)

Utilizator madboyGaspar Portik madboy Data 4 martie 2007 11:26:06
Problema Ograzi Scor 0
Compilator fpc Status done
Runda preONI 2007, Runda 3, Clasele 11-12 Marime 0.61 kb
program peroni33;
uses crt;
type
  TMeadow = array[1..10000,1..10000] of 0..1;
var sc, fc, w, h, fs:longint;
    M: TMeadow;

procedure Load;
var
  f: text;
  i, k, l: byte;
  x, y: longint;
begin
  fs := 0;
  Assign(f, 'ograzi.in');
  Reset(f);
  ReadLn(f, fc, sc, w, h);
  for i := 1 to fc do begin
    ReadLn(f, x, y);
    for k := x to x+w do begin
      for l := y to y+h do begin
        M[k,l] := 1;
      end;
    end;
  end;
  for i := 1 to sc do begin
    ReadLn(f, x, y);
    if M[x,y] = 1 then inc(fs);
  end;
  Close(f);
end;

begin ClrScr;
  Load;
  WriteLn(fs);

end.