Pagini recente » Cod sursa (job #2534804) | Cod sursa (job #1375434) | Cod sursa (job #1627274) | Cod sursa (job #29128)
Cod sursa(job #29128)
var f,g:text;
i,j,p,q:integer;
a,b:longint;
begin
assign(f,'gfact.in');
assign(g,'gfact.out');
rewrite(g);
reset(f);
readln(f,p,q);
close(f);
a:=1;
if (q<>0) then for i:=1 to q do a:=a*p;
if (q<=0) then for i:=1 downto q do a:=a*p;
for i:=1 to a do begin
b:=1;
for j:=1 to i do begin
b:=b*j;
end;
if b mod a=0 then begin
write(g,i);
break;
end;
end;
close(g);
end.