Pagini recente » Cod sursa (job #392519) | Cod sursa (job #1571234) | Cod sursa (job #2050535) | Cod sursa (job #2746617) | Cod sursa (job #146706)
Cod sursa(job #146706)
var a,b:longint;
t,i:byte;
f,g:text;
function fructe(a,b:longint):longint;
begin
if (a=1) and (b=1) then fructe:=1
else if (a=1) and (b=2) then fructe:=0
else if a>=b then fructe:=(fructe(a-1,b))
else fructe:=(fructe(a,b-1));
end;
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,a,b);
writeln(g,fructe(a,b-1));
end;
close(f); close(g);
end.