Pagini recente » Cod sursa (job #729326) | Cod sursa (job #1745918) | Cod sursa (job #2751248) | Cod sursa (job #2561277) | Cod sursa (job #248817)
Cod sursa(job #248817)
type vector=array [1..2500] of byte;
var f,g:text;
n:int64;
begin
assign(f,'fact.in');
reset(f);
assign(g,'fact.out');
rewrite(g);
read(f,n);
write(g,'-1');
close(f);
close(g);
{type vector=array [1..10000] of int64;
var j,o,i,p,d,c:longint;
f,g:text;
a,b:vector;
l:real;
r:int64;
function fact(x:longint):int64;
begin
o:=1;
for i:=1 to x do o:=o*i;
fact:=o;
end;
begin
assign(f,'fact.in');
reset(f);
assign(g,'fact.out');
rewrite(g);
read(f,p);
a[1]:=5;
b[1]:=1;
for i:=2 to p do begin
a[i]:=a[i-1]*5;
b[i]:=b[i-1]*5+1;
end;
d:=p;
l:=0;
for j:=d downto 1 do begin
if p>=b[j] then begin
l:=l+(p/b[j])*j;
p:=p mod b[j];
end;
end;
c:=trunc(l)*5;
write(g,c);
close(f);
close(g);}
end.