Pai nai ce face, citesti variabilele, daca intilnesti un numar par se mareste variabila par, altfel se mareste variabila impar si se mai verifica daca mai numarul se divide la 4. Dupa care controlezi si afisezi raspunsul.
var
x:array of integer;
n,p:integer;
i,par,impar,div4:integer;
begin
read(n,p);
setlength(x,n);
for i:=0 to n-1 do
begin
read(x[i]);
if(x[i] mod 2 = 0) then
inc(par)
else
inc(impar);
if(x[i] mod 4 = 0) then
inc(div4);
end;
if(par=n) then writeln('DA')
else writeln('NU');
if(impar=n) then writeln('DA')
else writeln('NU');
if(div4=n) then writeln('DA')
else writeln('NU');
if(par<>0) then writeln('DA')
else writeln('NU');
if(impar<>0) then writeln('DA')
else writeln('NU');
if(par=p) then writeln('DA')
else writeln('NU');
if(impar=p) then writeln('DA')
else writeln('NU');
end.