Cod sursa(job #560867)
| Utilizator | Data | 18 martie 2011 18:36:38 | |
|---|---|---|---|
| Problema | Factorial | Scor | 0 |
| Compilator | fpc | Status | done |
| Runda | Arhiva de probleme | Marime | 0.51 kb |
var n,p,a,b,d,i:longint;
begin
assign(input,'fact.in');reset(input);
assign(output,'fact.out');rewrite(output);
readln(p);
if p=5 then write('-1');
n:=1; b:=1;
//while p<>0 do begin
for i:=1 to n do begin
//if (i mod 2)=0 then inc(a);
if (i mod 5)=0 then inc(b);
d:=n;
inc(n);
end;
// if a>b then if (a-(a-b))=p then write(d);
if b=p then write(d,' ');
//end;
close(input);close(output);
end.