// var n,s,p,i:integer; - для значений n < 18
var n,s,i:integer; p:real;
begin
write('n = '); readln(n);
s:=0;
for i:=1 to n+1 do s:=s+i*i;
writeln('s = ',s);
p:=1;
for i:=1 to n-5 do p:=p*i*i*i;
writeln('p = ',p);
writeln('s/p = ',s,'/',p,' = ',s/p);
end.
Пример:
n = 10
s = 506
p = 1728000
s/p = 506/1728000 = 0.000292824074074074