var a,b,u,v,tmp,summ: real;
var i,n,k,factorial: integer;
begin
writeln('Введите u');
readln(u);
writeln('Введите v');
readln(v);
writeln('Введите n');
readln(n);
a:=u;
b:=v;
factorial:=1;
summ:=a*b;
for i:=2 to n do
factorial:=factorial*i;
tmp:=a;
a:=b*b+2*a;
b:=tmp*tmp+2*b;
summ:=summ+(a*b/(1.0*factorial));
end;
writeln('Сумма ряда при n = ',n,' равна ',summ);
end.
var a,b,u,v,tmp,summ: real;
var i,n,k,factorial: integer;
begin
writeln('Введите u');
readln(u);
writeln('Введите v');
readln(v);
writeln('Введите n');
readln(n);
a:=u;
b:=v;
factorial:=1;
summ:=a*b;
for i:=2 to n do
begin
factorial:=factorial*i;
tmp:=a;
a:=b*b+2*a;
b:=tmp*tmp+2*b;
summ:=summ+(a*b/(1.0*factorial));
end;
writeln('Сумма ряда при n = ',n,' равна ',summ);
end.