Pagini recente » Cod sursa (job #162051) | Cod sursa (job #1060933) | Cod sursa (job #3177528) | Cod sursa (job #118838) | Cod sursa (job #253548)
Cod sursa(job #253548)
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
else zero:=zero+1;
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.