Cod sursa(job #637343)

Utilizator andreifirstCioara Andrei Ioan andreifirst Data 20 noiembrie 2011 13:54:54
Problema ChatNoir Scor 100
Compilator fpc Status done
Runda .com 2011 Marime 0.53 kb
var t, m, n, x, y, i:longint;
    ok:boolean;
    f, g:text;
    buf1, buf2:array [1.. 1 shl 17] of char;

begin
assign (f, 'chatnoir.in'); settextbuf (f, buf1); reset (f);
assign (g, 'chatnoir.out'); settextbuf (g, buf2); rewrite (g);

readln (f, t);
for i := 1 to t do
  begin
  readln (f, n, m, x, y);
  ok:=false;
  if x<6 then ok:= true;
  if y<6 then ok:= true;
  if n-x<5 then ok:= true;
  if m-y<5 then ok:= true;
  if ok= true then writeln (g, 'DA') else writeln (g, 'NU');
  end;

close (f); close (g);
end.