Pagini recente » Cod sursa (job #68928) | Monitorul de evaluare | Cod sursa (job #1846676) | Cod sursa (job #79104) | Cod sursa (job #895872)
Cod sursa(job #895872)
Program copac;
var
t,i:byte;
p,b:longint;
cin,cout:text;
begin
assign(cin,'fructe.in');reset(cin);
assign(cout,'fructe.out');rewrite(cout);
readln(cin,t);
for i:=1 to t do
begin
read(cin,p,b);
if (b mod 2=0) then
begin
p:=p+(b div 2);
b:=0;
end
else
begin
p:=p+(b div 2);
b:=1;
end;
if (b=1) then
writeln(cout,1);
if (b=0) then
writeln(cout,0);
end;
close(cin);
close(cout);
end.