Cod sursa(job #283490)

Utilizator inlinestunter19Aab Bba inlinestunter19 Data 19 martie 2009 11:09:20
Problema Suma divizorilor Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.31 kb
var a,b,c,s,i,r,x,y:longint;   f,g:text;
begin
assign(f,'sumdiv.in'); reset(f);
assign(g,'sumdiv.out'); rewrite(g);
read(f,a,b);
s:=maxint;
c:= a shl (b-1);
for i:=1 to c do
 if c mod i=0 then
 s:=s+i;
x:=9901 div s;
y:=trunc(x);
r:=9901-(y*s);
if r=1 then r:=s;
writeln(g,r);
close(f); close(g);
end.