Pagini recente » Cod sursa (job #1578603) | Cod sursa (job #2690108) | Cod sursa (job #86062) | Cod sursa (job #401015) | Cod sursa (job #23163)
Cod sursa(job #23163)
var n,t,u: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);
while not eof 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:=1 to n do ok:=ok and (tt[i]=tu[i]) and (tt[-i]=tu[-i]);
if ok then writeln('DA') else writeln('NU');
end;
close(input); close(output);
end.