Pagini recente » Cod sursa (job #408292) | Diferente pentru problema/drumuri1 intre reviziile 4 si 5 | Cod sursa (job #1655369) | Cod sursa (job #519647) | Cod sursa (job #21581)
Cod sursa(job #21581)
var s,a,b:int64;
i,x:int64;
f,g:text;
begin
assign(f,'sumdiv.in'); reset(f);
assign(g,'sumdiv.out'); rewrite(g);
read(f,a,b);
i:=0;
x:=1;
while i<b+1 do begin
inc(i);
x:=(x*a) mod 9901;
end;
if (a<>0) and (a<>1) then
writeln(g,(x-1) div (a-1))
else
if a=0 then
writeln(g,'0')
else
writeln(g,'1');
close(f);
close(g);
end.