Pagini recente » Cod sursa (job #2580278) | Cod sursa (job #174402) | Cod sursa (job #1266035) | Cod sursa (job #1496001) | Cod sursa (job #46542)
Cod sursa(job #46542)
var f,g:text;
t,pop:byte;
grpo:array[1..25000]of word;
pcons,k,i,j,n:word;
begin
assign(f,'bowling.in');
assign(g,'bowling.out');
rewrite(g);
reset(f);
read(f,t);
for i:=1 to t do
begin
read(f,n);
k:=0;
j:=0;
pcons:=0;
for j:=1 to n do
begin
read(f,pop);
if(pop=1)then
pcons:=pcons+1
else
begin
k:=k+1;
grpo[k]:=pcons;
pcons:=0;
end;
end;
if pcons<>0 then
begin
k:=k+1;
grpo[k]:=pcons;
end;
for j:=2 to k do
grpo[1]:=grpo[1] xor grpo[j];
if(grpo[1]=0)then
writeln(g,'Fumeanu')
else
writeln(g,'Nargy');
end;
close(f);
close(g);
end.