Pagini recente » Cod sursa (job #2981520) | Cod sursa (job #3222674) | Cod sursa (job #2248514) | Cod sursa (job #1286232) | Cod sursa (job #895784)
Cod sursa(job #895784)
Program copac;
var
p,b,x,n,cp,cb,i:longint;
cin,cout:text;
begin
assign(cin,'fructe.in');reset(cin);
assign(cout,'fructe.out');rewrite(cout);
read(cin,n);
for i:=1 to n do
begin
read(cin,p,b);
if (b mod 2=0) then
begin
p:=p+(b div 2);
b:=1;
end
else
begin
p:=p+(b div 2);
b:=0;
end;
if (b=0) then
writeln(cout,0);
if (b=1) then
writeln(cout,1);
end;
close(cin);
close(cout);
end.