Cod sursa(job #387554)

Utilizator SykzGabris Marius Sykz Data 27 ianuarie 2010 21:37:11
Problema Factorial Scor 0
Compilator fpc Status done
Runda Arhiva de probleme Marime 0.3 kb
var p,n,s,x:longint;
begin
readln(p);
if (p>=1) and (p<6) then begin n:=5; s:=1; end;
if (p>=6) and (p<31) then begin n:=25; s:=6; end;
if (p>=31) and (p<156) then begin n:=125; s:=31; end;
if (p>=156) and (p<781) then begin n:=625; s:=156; end;
x:=n+ (p-s)*5;
writeln(x);
readln;
end.