Cod sursa(job #116175)
Utilizator | claudiu claudiu_sy | Data | 17 decembrie 2007 21:59:38 |
---|---|---|---|
Problema | Factorial | Scor | 0 |
Compilator | fpc | Status | done |
Runda | Arhiva de probleme | Marime | 0.34 kb |
var p,n,i,min:longint;
f,g:text;
ok:boolean;
begin
assign(f,'fact.in');
assign(g,'fact.out');
reset(f);
rewrite(g);
readln(f,p);
ok:=false;
i:=1;
repeat
if (i div 5=p-1) then
begin
writeln(g,i);
ok:=true;
end;
i:=i+1;
until (ok=true) or (i=2147483647);
if not(ok) then writeln(g,-1);
close(f);
close(g);
end.