Cod sursa(job #917551)

Utilizator atatomirTatomir Alex atatomir Data 18 martie 2013 08:59:19
Problema ChatNoir Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.6 kb
var n,m,x,y,min:longint;
    t,i:longint;
    bufin,bufout:array[1..65000]of byte;

begin
  assign(input,'chatnoir.in'); reset(input);
  assign(output,'chatnoir.out'); rewrite(output);
  settextbuf(input,bufin);
  settextbuf(output,bufout);


  readln(t);

  for i := 1 to t do
  begin
    readln(n,m,x,y);

    min := x+1;
    if min > n-x+1 then min := n-x+1;
    if min > y     then min := y;
    if min > m-y+1 then min := m-y+1;

    if min > 5 then writeln('NU') else writeln('DA');
    //writeln(x,' ',n-x+1,' ',y,' ',m-y+1);

  end;



  close(input);
  close(output);
end.