program suma;
var n, i, a:integer;
s:real;
begin
write('n= '); read(n);
s:=0;
for i:=1 to (n div 2) do
begin
a:=2*i;
s:=s+a/(a-1) + a/(a+1);
end;
if (n mod 2=1) then s:=s+(a+2)/(a+1);
writeln('Suma solicitata = ', s);
end.
**************************************************
program sumaVarianta2;
var n, i, a, ind:integer;
s:real;
begin
write('n= '); read(n);
s:=0; ind:=0; a:=0;
for i:=1 to n do
begin
ind:=ind+1;
if ind mod 2=1 then a:=a+2;
if i mod 2=1 then s:=s+a/(a-1)
else s:=s + a/(a+1);
end;
writeln('Suma solicitata = ', s);
end.