Pagini recente » Cod sursa (job #675485) | Cod sursa (job #1436213) | Cod sursa (job #1892723) | Cod sursa (job #1739160) | Cod sursa (job #23160)
Cod sursa(job #23160)
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.