Cod sursa(job #639188)
Utilizator | Malai Mihai MalaiMihai | Data | 22 noiembrie 2011 18:28:48 |
---|---|---|---|
Problema | ChatNoir | Scor | 100 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.43 kb |
var f1,f2:text;
a:array[1..4] of integer;
t,i:longint;
n,m,x,y,min,j:integer;
begin
assign(f1,'chatnoir.in');
reset(f1);
assign(f2,'chatnoir.out');
rewrite(f2);
readln(f1,t);
for i:=1 to t do
begin
readln(f1,n,m,x,y);
a[1]:=x-1;
a[2]:=y-1;
a[3]:=n-x;
a[4]:=m-y;
min:=a[1];
for j:=2 to 4 do
if a[j]<min then min:=a[j];
if min<=4 then writeln(f2,'DA') else writeln(f2,'NU');
end;
close(f1);
close(f2);
end.