Cod sursa(job #756184)
Utilizator | Data | 9 iunie 2012 10:03:24 | |
---|---|---|---|
Problema | Suma divizorilor | Scor | 10 |
Compilator | fpc | Status | done |
Runda | Remember Mihai Pătrașcu | Marime | 0.29 kb |
var f,g:text;a,b,i,j,x,y:longint;s,z:int64;
function pw(x,y:longint):int64;
begin z:=1;
for j:=1 to y do
z:=z*x;
pw:=z;
end;
begin
assign(f,'sumdiv.in');reset(f);assign(g,'sumdiv.out');rewrite(g);
read(f,a,b);s:=1;
for i:=1 to b do
s:=s+pw(a,i);
write(g,s);close(f);close(g);end.