Pagini recente » Cod sursa (job #3159809) | Cod sursa (job #707635) | Cod sursa (job #778065) | Cod sursa (job #1730152) | Cod sursa (job #124897)
Cod sursa(job #124897)
Program fructe;
VAR
t,i:byte;
p,b:longint;
fin,fout:text;
begin
assign(fin,'fructe.in');
reset(fin);
assign(fout,'fructe.out');
rewrite(fout);
readln(fin,t);
for i:=1 to t do
begin
read(fin,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(fout,'1');
if(b=0) then
writeln(fout,'0');
end;
close(fin);
close(fout);
end.