Pagini recente » Cod sursa (job #1394328) | Cod sursa (job #478947) | Cod sursa (job #555721) | Statistici Poienaru Codrin (kid_tm) | Cod sursa (job #820192)
Cod sursa(job #820192)
var m,n:longint;i,t:byte;
f,g:text;
Begin
assign(f,'fructe.in');reset(f);
assign(g,'fructe.out');rewrite(g);
readln(f,t);
For i:=1 to t do
Begin
readln(f,m,n);
Repeat
If m>0 then
m:=m-1
else
If n>=2 then
Begin
n:=n-2;
m:=m+1
end;
until((m=1) and (n=0)) or ((m=0) and (n=1));
If m=1 then
writeln(g,'0')
else
writeln(g,'1');
end;
close(f);
close(g);
end.