Cod sursa(job #301448)

Utilizator Cristian_BBerceanu Cristian Cristian_B Data 8 aprilie 2009 11:13:59
Problema Suma divizorilor Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.35 kb
var i,n,m:longint;
    p,s:int64;
    f,g:text;
procedure load;
begin
assign(f,'sumdiv.in');
reset(f);
readln(f,n,m);
closE(f);
assign(g,'sumdiv.out');
rewrite(g);
end;
BEGIN
load;
p:=1;s:=0;
for i:=1 to m+1 do
begin
s:=s+p;
p:=p*n;
end;
if b=0 then s:=1;
if a=0 then s:=0;
if (a=0) and (b=0) then s:=1;
writeln(g,s);
close(g);
END.