Pagini recente » Cod sursa (job #1880967) | Cod sursa (job #968090) | Diferente pentru problema/secvente2 intre reviziile 7 si 11 | Borderou de evaluare (job #3158864) | 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.