moshkit

ARTIST

Jan 6th, 2020
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.50 KB | None | 0 0
  1. program hudozhik;
  2.  
  3. var
  4.   i, w, h, a, n, S, b, x1, x2, y1, y2: integer;
  5.   holst: array [,] of integer;
  6.  
  7. begin
  8.   Readln(h, w);
  9.   holst := new integer[w, h];
  10.   Readln(n);
  11.   for a := 0 to w - 1 do
  12.     for b := 0 to h - 1 do
  13.       holst[a, b] := 1;
  14.   for i := 1 to n do
  15.   begin
  16.     Readln(x1, y1, x2, y2);
  17.     for a := x1 to x2 - 1 do
  18.       for b := y1 to y2 - 1 do
  19.         holst[a, b] := 0;
  20.   end;
  21.   for a := 0 to w - 1 do
  22.     for b := 0 to h - 1 do
  23.       S := S + holst[a, b];
  24.   Writeln(S);
  25. end.
Advertisement