Pagini recente » Cod sursa (job #1859027) | Cod sursa (job #1281158) | Cod sursa (job #253301) | Cod sursa (job #405916) | Cod sursa (job #23161)
Cod sursa(job #23161)
var n,t,u,w,k:integer;
tt,tu,zero:array[-50..50]of integer;
i,nr:integer;
ok:boolean;
begin
assign(input,'amlei.in'); reset(input);
assign(output,'amlei.out'); rewrite(output);
readln(w);
for k:=1 to w do begin
readln(n,t,u); tt:=zero; tu:=zero;
for i:=1 to n*t do begin
read(nr); tt[nr]:=1;
end;
readln;
for i:=1 to n*u do begin
read(nr); tu[nr]:=1;
end;
readln;
ok:=true; for i:=-n to n do ok:=ok and (tt[i]=tu[i]);
if ok then writeln('DA') else writeln('NU');
end;
close(input); close(output);
end.