function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 2 to n do
rez := rez * i;
Fact := rez;
end;
function Pow(a, x:integer):integer;
for i := 1 to x do
rez := a * rez;
Pow := rez;
a, b, n, i:integer;
F:real;
write('a = '); readln(a);
write('b = '); readln(b);
write('n = '); readln(n);
F := 0;
for i := 1 to n do
F := F + Fact(n - i + 1)/(Pow(a,i) - Pow(b, i));
writeln('F = ', F);
end.
function Fact(n:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 2 to n do
rez := rez * i;
Fact := rez;
end;
function Pow(a, x:integer):integer;
var
rez, i:integer;
begin
rez := 1;
for i := 1 to x do
rez := a * rez;
Pow := rez;
end;
var
a, b, n, i:integer;
F:real;
begin
write('a = '); readln(a);
write('b = '); readln(b);
write('n = '); readln(n);
F := 0;
for i := 1 to n do
F := F + Fact(n - i + 1)/(Pow(a,i) - Pow(b, i));
writeln('F = ', F);
end.