Pagini recente » Cod sursa (job #1279303) | Cod sursa (job #835645) | Cod sursa (job #2448009) | Monitorul de evaluare | Cod sursa (job #266474)
Cod sursa(job #266474)
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 i,j,k,c:longint;
begin
readln(k);
c:=0;
for i:=1 to 99999 do begin
c:=c+test(i);
if c>k then j:=-1;
if c=k then begin j:=i; break; end;
end;
if k=0 then write(1) else write(j);
readln;
end.