Pagini recente » Cod sursa (job #886541) | Cod sursa (job #1567045) | Cod sursa (job #1087983) | Cod sursa (job #1896654) | Cod sursa (job #266437)
Cod sursa(job #266437)
function test(n:integer):integer;
begin
test:=0;
if (n mod 100=25) or (n mod 100=50) or (n mod 100=75) then test:=2
else if (n mod 10=5) or (n mod 10=0) then test:=1;
end;
var n,i,j,k,c:longint;
begin
assign(input,'fact.in');
assign(output,'fact.out');
reset(input);
rewrite(output);
readln(k);
for i:=1 to 999 do begin
c:=c+test(i);
if c>=k then begin j:=i; break; end;
end;
if k=0 then write(1) else write(j);
readln;
close(input);
close(output);
end.