Pagini recente » Cod sursa (job #2127997) | Cod sursa (job #1255485) | Cod sursa (job #2229080) | Cod sursa (job #1507958) | Cod sursa (job #253550)
Cod sursa(job #253550)
var p,n,zero,j:longint;
begin
n:=0;
assign(input,'fact.in'); reset(input);
readln(p);
while zero<p do
begin
n:=n+5;
j:=n;
while j mod 5 = 0 do
begin
zero:=zero+1;
j:=j div 5;
end;
end;
assign(output,'fact.out'); rewrite(output);
if((zero<>0) and (zero=p)) then writeln(n)
else if zero>p then writeln('-1')
else writeln('1');
close(output);
end.