Problem:


Score : 500 points

Problem Statement

Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(123) = 1 + 2 + 3 = 6.

We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds.

Given an integer K, list the K smallest Snuke numbers.

Constraints

1 \leq K

The K-th smallest Snuke number is not greater than 10^{15}.

Input

Input is given from Standard Input in the following format:

K

Output

Print K lines. The i-th line should contain the i-th smallest Snuke number.

Sample Input 1

10

Sample Output 1

1
2
3
4
5
6
7
8
9
19



Sample input:
10


Sample output:
1
2
3
4
5
6
7
8
9
19

Submission status: Wrong Answer

Solution code:
k = int(input())
snuke_nums = []
while len(snuke_nums) < k:
    for i in range(15):
        snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])

for i in range(k):
    print(snuke_nums[i])

Submission status: Wrong Answer

Solution code:
k = int(input())

def s(n):
  return sum(int(d) for d in (n))

for i in range(k):
  print(i % 9 + 1, end='')
  for _ in range(i // 9):
    print('9',  end='')
  print()

Submission status: Wrong Answer

Solution code:
m = int(input())
if m <= 9:
    for i in range(m):
        print(m+1)
else:
    for i in range(9):
        print(i+1)
    for i in range(m-9):
        print(str(i+1)+'9')

Submission status: Wrong Answer

Solution code:

def eval_sn(n):
    s = str(n)
    ans = 0
    for i in s:
        ans += int(i)
    return n/ans

if __name__ == "__main__":
    K = int(input())
    n = 1
    Sn = [0]
    Sn.append(eval_sn(n))
    while K != 0:
        n += 1
        #
        Sn.append(eval_sn(n))
        if Sn[n-1] <= Sn[n]:
            K -= 1
            print(n-1)
            continue

Submission status: Wrong Answer

Solution code:
k = int(input())
ans = []

def s(n):
    n = str(n)
    sn = 0
    for num in range(len(n)):
        sn += int(n[num])
    return sn

i = 1
while(len(ans) <= k):
    if i < 10:
        ans.append(i)
    else:
        if s(i)*(i+1) >= s(i+1)*i:
            ans.append(i)
    i += 1

for i in range(k):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
K = int(input().strip())

c = 0
k = 0
i = 0
while True:
  i += 1
  print(str(i) + '9' * c)
  k += 1
  if k >= K:
    break
  if i == 9:
    i = 0
    c += 1

Submission status: Wrong Answer

Solution code:
"""
すぬけ
"""
def sn(i):
    tmp = i % 10
    sn = tmp
    tmp1 = math.floor(i/10)
    while tmp1 > 0:
        tmp = tmp1 % 10
        sn += tmp
        tmp1 = math.floor(tmp1/10)
    return sn

import math
list  = []
k = int(input())
max = 0
i = 0
cnt = 1
while i != k:
    """
    si = i / sn(i)
    print("si = "+str(si))
    if si >= max:
        list.append(i)
        max = si
        i += 1
    """
    if math.floor(cnt / 10) == 0:
        list.append(cnt)
        i += 1
    elif cnt % 10 == 9:
        list.append(cnt)
        i += 1
    cnt += 1

for i in list:
    print(i)

Submission status: Wrong Answer

Solution code:
k = input()
num = 1
ans = 0
while ans < int(k):
    if (num/sum(list(map(int,str(num))))) > ((num+1)/sum(list(map(int,str(num+1))))):
        pass
        num += 1
    elif (num/sum(list(map(int,str(num))))) > ((num+2)/sum(list(map(int,str(num+2))))):
        pass
        num += 1
    elif (num/sum(list(map(int,str(num))))) > ((num+3)/sum(list(map(int,str(num+3))))):
        pass
        num += 1
    elif (num/sum(list(map(int,str(num))))) > ((num+5)/sum(list(map(int,str(num+5))))):
        pass
        num += 1
    elif (num/sum(list(map(int,str(num))))) > ((num+8)/sum(list(map(int,str(num+8))))):
        pass
        num += 1
    elif (num/sum(list(map(int,str(num))))) > ((num+9)/sum(list(map(int,str(num+9))))):
        pass
        num += 1
    else:
        print(num)
        num += 1
        ans += 1

Submission status: Wrong Answer

Solution code:
K_s = input()
sum = 0
for letter in K_s:
    sum = sum + int(letter)
K = int(K_s)
for n in range(1, K//sum):
    print(n)
count = K//sum-1
for i in range(2, K//(K//sum)+2):
    if count == K:
        break
    for j in reversed(range(sum*i)):
        if count == K:
            break
        print(K*i-j)
        count = count + 1

Submission status: Wrong Answer

Solution code:
K = int(input())
digits = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(K):
    disp = str(digits[i % 9])
    n_nine = int(i / 9)
    for j in range(n_nine):
        disp += '9'
    if int(disp) <= 10**15:
        print(int(disp))

Submission status: Wrong Answer

Solution code:
k = int(input())
ans = []
for i in range(0, 19):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    if ans[i] > 10 ** 15:
        break
    print(ans[i])

Submission status: Wrong Answer

Solution code:
def S(n):
    ans = 0
    for s in str(n):
        ans += int(s)
    return ans

K = int(input())

for i in range(1, K + 1):
    if i >= 10:
        print(19 + 10 * (i - 10))
    else:
        print(i)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
K = int(input())
if K <= 9:
    for i in range(1,K+1):
        print(i)
else:
    for i in range(1, 10):
        print(i)
    K -= 9
    for i in range(K):
        num = 19 + 10 * i
        print(num)

Submission status: Wrong Answer

Solution code:
K = int(input())

loop1 = K // 9
loop2 = K % 9

for i in range(0, loop1+1):
    end = 10
    # 最後のループ
    if i == loop1:
        end = loop2+1
    #print('### %d, %d' % (i, end))
    for j in range(1, end):
        nines = 0
        if i > 0:
            nines = int('9' * i)
        print(nines + (j * 10 ** i))

Submission status: Wrong Answer

Solution code:
k = int(input())
snuke_nums = []

for i in range(100):
    snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])

for i in range(k):
    print(snuke_nums[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 9:
        print(i+1)
    else:
        for j in range(100):
            temp = j+1
            if i//(9*temp) == 0:
                break
        print(10**j*(i-9*j+2)-1)

Submission status: Wrong Answer

Solution code:
K = int(input())
result_list = []
for i in range(1,K+1):
    result = 0
    a = i // 9
    b = i % 9
    for j in range(0,a):
        result += 9 * (10 ** j)
    result += b * (10 ** a)
    result_list.append(result)
for i in result_list:
    print (i)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
  top_number = i % 9
  if top_number == 0:
    top_number = ''
  number_of_nine = int(i/9)
  number = str(top_number)+'9'*number_of_nine
  if i >= 136:
    print(pow(10,15))
  else:
    print(number)

Submission status: Wrong Answer

Solution code:
import math
K = int(input())

for i in range(K):
	if i < 9:
		print(i+1)
	else:
		s = ""
		for j in range(math.floor(i/9)):
			s = s + "9"
		t = str(i % 9 + 1)
		s = t + s
		print(s)

Submission status: Wrong Answer

Solution code:
k = int(input())
if k <= 10:
    for i in range(1, k):
        print(i)
else:
    for i in range(1, 10):
        print(i)

    for i in map(lambda x: str(x) + '9', range(1, k//10)):
        print(i)

    if str(k)[-1] == '9':
        print(k)

Submission status: Wrong Answer

Solution code:
K=int(input())
max=0
f=lambda x:x/sum(map(int,str(x)))
n=0
while K:
    n+=1
    if f(n)<=f(n+1):
        print(n)
        K-=1

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1, K + 1):
    moji = ''
    margin = i % 9
    sho = i // 9
    if margin == 0:
        for j in range(sho):
            moji += '9'
    else:
        moji += str(i % 9)
        for j in range(sho):
            moji += '9'
    print(moji)

Submission status: Wrong Answer

Solution code:
k = int(input())
if k <= 9 :
    roop = k
    for i in range(1,k+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    counter = 0
    max_count = k-9
    for i in range(19,1000000000000000,10):
        print(i)
        counter += 1
        if counter == max_count:
            break

Submission status: Wrong Answer

Solution code:
k = input()
num = 1
ans = 0
while ans < int(k):
    if (num/sum(list(map(int,str(num))))) > ((num+1)/sum(list(map(int,str(num+1))))):
        pass
        num += 1
    else:
        print(num)
        num += 1
        ans += 1

Submission status: Wrong Answer

Solution code:
import sys
K = int(raw_input())
c = 0
for i in range(0, 20):
  for j in range(1, 10):
    print str(j)+"9"*i
    c += 1
    if c >= K:
      sys.exit(0)

Submission status: Wrong Answer

Solution code:
def digit_sum(i):
	list_i = [int(x) for x in str(i)]
	return sum(list_i)

K = int(input())
Sn = []
for i in range(1, pow(10, 15) + 1):
	if i / digit_sum(i) <= (i + 1) / digit_sum(i + 1):
		Sn.append(i)
	if len(Sn) == K:
		break
for i in range(len(Sn)):
	print(Sn[i])

Submission status: Wrong Answer

Solution code:
k = int(input())

i = 1
j = 0

while True:
    if j == k:
        break

    if (i / sum(list(map(int, str(i))))) <= ((i + 1) / sum(list(map(int, str(i + 1))))):
        print(i)
        j += 1

    i += 1

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1, 10):
    if K < i:
        break
    else:
        print(i)

num = 19

for i in range(10, K+1):
    print(num)
    num += 10

Submission status: Wrong Answer

Solution code:
k = int(input())

keta = 1

while k // pow(10, keta) > 0:
    keta += 1


def sunuke(i):
    return i / sum([int(c) for c in str(i)])


for x in sorted([(sunuke(i), i) for i in range(1, pow(10, keta) + 1)])[:k]:
    print(x[1])

Submission status: Wrong Answer

Solution code:
import math
k = int(input())
if k <= 9:
    for i in range(1,k+1):
        print(i)
    exit()
cou = int(math.ceil(k/9))
co = k % 9
for i in range(cou):
    if i != cou-1:
        for m in range(1,10):
            print(str(m)+"9"*(i))
    else:
        for m in range(1,co+1):
            print(str(m)+"9"*(i))

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# coding: utf-8
#


def main(k):
    counter = 0
    val = 1
    step_val = 1
    while counter < k:
        # 出力
        print(val)
        # 桁数を確認
        order = len(str(val))
        # 最上位数値(most significant numとする)を確認
        msn = (val - (val % (10 ** (order - 1)))) / (10 ** (order - 1))
        # print('msn: ', msn)
        # 次に進む
        if msn == 9:
            step_val *= 10
        val += step_val
        counter += 1
        

if __name__ == '__main__':
    try:
        k = int(input().strip())
        main(k)
    except EOFError:
        pass

Submission status: Wrong Answer

Solution code:
K = int(input())
sunuke_list = []
a = K //9
b = K % 9
result = 0
for i in range(0,a):
    result += 9 * (10 ** i)
result += b * (10 ** a)
print(result)

Submission status: Wrong Answer

Solution code:
from sys import stdin

K = int(stdin.readline().rstrip())

limit = K - 9
count = 0
num = 10

if K <= 9:
    for i in range(1, K+1):
        print(i)
else:
    for i in range(1, K):
        print(i)
    while True:
        tmp = str(num)[::-1]
        if int(tmp[0]) == 9:
            print(num)
            count += 1
        num += 1
        if limit == count:
            break

Submission status: Wrong Answer

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, list(s)))
    return sum(array)

lst = [0]
ans = []
k = int(input())
tmp = 0
cnt = 0
i = 1
while cnt != k:
    if i%10 == 9 or i < 10:
        print(i)
        cnt += 1
    i += 1

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 1
plus = 1
ima = 0
while True:
    print(i)
    got = plus * 10
    if i == got:
        plus = got
    i += plus
    ima += 1
    if ima == k:
        break

Submission status: Wrong Answer

Solution code:
N = int(input())

i = 1
cnt = 0
while( N > cnt ):
  if i == 1:
    print(1)
    i += 1
    cnt += 1
    continue
  if i % 10 == 0:
    i += 1
    continue
  print(str(i % 10) + "9" * (i // 10) )
  i += 1
  cnt += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

second_counter = 10
for i in range(k):
    if i < 9: 
        print(i + 1)
    else:
        print(second_counter + 9)
        second_counter += 10

Submission status: Wrong Answer

Solution code:
K = int(input())
iK = int(K/9)
counter = 0
gcounter = 0
for gcounter in range(iK):
    for i in range(1,10):
        a = i*10**gcounter-1
        if a != 0:
            print(i*10**gcounter-1)
            counter += 1
gcounter += 1
rest = K - counter
for i in range(1,rest+1):
    print(i*10**gcounter-1)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def s(n):
    s_n = 0
    tmp = n

    while tmp > 0:
        s_n += tmp % 10
        tmp //= 10
    return s_n


k = int(input())

for i in range(1, k+1):
    if i < 10:
        print(i)
    else:
        j = i-9
        if j % 10 == 0:
            continue
        k = 10 ** (j//10 + 1)
        # print(k)
        x = k * (j % 10) + k - 1
        print(x)

Submission status: Wrong Answer

Solution code:
import math
import numpy as np
 
line = input().split()
K = int(line[0])

for k in range(1, K+1):
    if k < 10:
        print(k)
    else:
        print((k - 9)*10+9)

Submission status: Wrong Answer

Solution code:
k = int(input())

def sunuke(n):
    nlist = list(str(n))
    sn = 0
    for i in nlist:
        sn += int(i)

    return n/sn

start = 1
counter = 0

while counter < k:
    if sunuke(start) <= sunuke(start + 1):
        print(start)
        counter += 1
    start += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
  top_number = i % 9
  if top_number == 0:
    top_number = ''
  number_of_nine = int(i/9)
  number = str(top_number)+'9'*number_of_nine
  if i >= 127:
    print()
  else:
    print(number)

Submission status: Wrong Answer

Solution code:
K = int(input())
digits = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(K):
    disp = str(digits[i % 9])
    n_nine = int(i / 9)
    for j in range(n_nine):
        disp += '9'
    if int(disp) <= 10**15:
        print(disp)

Submission status: Wrong Answer

Solution code:
A = input()

def calc_sum(target):
    num = str(target)
    a_sum = 0
    for i in num:
        a_sum += int(i)
    return a_sum

def check_num(num):
    if num <= 0:
        return False
    elif (num)/ calc_sum(num) <= (num+1)/calc_sum(num+1):
        return True
    else:
        return False

count = 0
i = 0
while(count < int(A)):
    if check_num(i):
        print(i)
        count +=1
    i += 1

Submission status: Wrong Answer

Solution code:
K=int(input().strip())
nines=0
ct=0
while ct<K:
    ketact=9 if nines in (0,1) else 18
    for i in range(1,ketact+1):
        print(str(i)+"9"*nines)
        ct+=1
        if ct==K:
            break
    nines+=1

Submission status: Wrong Answer

Solution code:
K = int(input())

if K < 10:
    num_list = [i for i in range(1, K+1)]
    print(*num_list, sep='\n')
else:
    num_list = [i for i in range(1, 10)]
    n = 19
    while len(num_list) < K:
        if str(n)[-1] == '9':
            num_list.append(n)
        n += 1
    print(*num_list, sep='\n')

Submission status: Wrong Answer

Solution code:
K=int(input())
count=0
digit=0
while (1):
    for i in range(1,10):
        out = int(str(i) + "9" * digit)
        print(out)
        count = count + 1
        if (count >= K) :
            break;
    digit = digit+1
    if (count >= K) :
        break;

Submission status: Wrong Answer

Solution code:
def make(keta):
    num = '9' * (keta - 1)
    for i in range(1,10):
        s = str(i) + num
        
        print(int(s))
        
def make_(keta, res):
    num = '9' * keta
    for i in range(1,1+res):
        s = str(i) + num
        
        print(int(s))

K = int(input())

keta = K // 9
res = K % 9

for i in range(keta):
    make(i)

make_(keta, res)

Submission status: Wrong Answer

Solution code:
k = int(input())

i = 1
j = 0

while True:
    if j == k:
        break

    if k < 10:
        print(i)
        i += 1
        j += 1
        continue
    
    if (i / sum(list(map(int, str(i))))) <= ((i + 1) / sum(list(map(int, str(i + 1))))):
        print(i)
        i += 1
        j += 1
        continue

    i += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
digits = [1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in range(K):
    disp = str(digits[i % 9])
    n_nine = int(i / 9)
    for j in range(n_nine):
        disp += '9'
    print(disp)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
  top_number = i % 9
  if top_number == 0:
    top_number = ''
  number_of_nine = int(i/9)
  number = str(top_number)+'9'*number_of_nine
  if i >= 126:
    print('9'*14)
  else:
    print(number)

Submission status: Wrong Answer

Solution code:
K = int(input())

def snuke(i):
	a = i % 9
	b = i // 9
	return (a+1) * 10**b-1

for i in range(1,K+1):
	print(snuke(i))

Submission status: Wrong Answer

Solution code:
k = int(input())
n = ['1']
for i in range(k):
    print(''.join(n))
    if n[0] != '9':
        n[0] = chr(ord(n[0])+1)
    else:
        n.insert(0,'1')

Submission status: Wrong Answer

Solution code:
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
def s(n):
	ans = 0
	for x in str(n):
		ans += int(x)
	return ans

k = int(input())
# for i in range(1, k+1):
# 	print(i, s(i), i/s(i))
it = 0
i = 19
while it < k:
	# i = it+1
	# print(i, s(i), i/s(i))
	if it+1 < 10:
		print(it+1)
	else:
		# print(i, s(i), i/s(i))
		print(i)
		i += 10
	if i > 99:
		break
	it += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
c = 0
s = ''
i = 1
while c < K:
    print(str(i)+s)
    if i == 9:
        i = 1
        s += '9'
    else:
        i += 1
    c += 1

Submission status: Wrong Answer

Solution code:
from collections import defaultdict as dd
from collections import Counter
from pprint import pprint as pp
import itertools as it
import functools
import math

YN = {True: 'Yes', False: 'No'}
ri = lambda: int(input())
ria = lambda: list(map(int, input().split()))
rian = lambda n: [ria() for _ in range(n)]
rs = lambda: input()
rsa = lambda: input().split()
rsn = lambda n: [rs() for _ in range(n)]

K = ri()

def Sx(i):
  return i/sum(int(s) for s in str(i))

def gen(cnt):
  mi = 1
  ms = Sx(mi)
  while cnt > 0:
    ni, ns = mi, ms
    mi += 1
    ms = Sx(mi)
    if ns <= ms:
      yield ni
      cnt -= 1

for ni in gen(K):
  print(ni)

Submission status: Wrong Answer

Solution code:
K = int(input())
Kc = K - 9
for i in range(1,10):
	print(i)

i += 1
flag = True

while(flag):
	if(i % 10 == 9):
		print(i)
		Kc -= 1
		if(Kc == 0):
			flag = False
	i += 1

Submission status: Wrong Answer

Solution code:
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
def s(n):
	ans = 0
	for x in str(n):
		ans += int(x)
	return ans

k = int(input())
# for i in range(1, k+1):
# 	print(i, s(i), i/s(i))
it = 0
i = 19
while it < k:
	# i = it+1
	# print(i, s(i), i/s(i))
	if it+1 < 10:
		print(it+1)
	else:
		print(i, s(i), i/s(i))
		i += 10
	if i > 99:
		break
	it += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

i = 1
j = 0

while True:
    if k < 10:
        print(i)
        i += 1
        j += 1
        continue
    
    if (i / sum(list(map(int, str(i))))) <= ((i + 1) / sum(list(map(int, str(i + 1))))):
        print(i)
        i += 1
        j += 1
        continue
    
    if j == k:
        break

    i += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
  top_number = i % 9
  if top_number == 0:
    top_number = ''
  number_of_nine = int(i/9)
  number = str(top_number)+'9'*number_of_nine
  if i == 127:
    print(pow(10,15))
  else:
    print(number)

Submission status: Wrong Answer

Solution code:
from itertools import chain, count, islice
k = int(input())
for x in islice(chain.from_iterable(((int(c + '9'*i) for c in '123456789') for i in count())), k):
    print(x)

Submission status: Wrong Answer

Solution code:
def a(n):
    if n < 10:
        return n
    else:
        return (n - 10) * 10 + 19
    
K = int(input())
for i in range(1, K+1):
    print(a(i))

Submission status: Wrong Answer

Solution code:
k = int(input())
a = [1,2,3,4,5,6,7,8,9]
if k <= 9:
    for i in a:
        print(i)
        k -= 1
        if k == 0 :
            break
else:
    for i in a:
        print(i)
    k -= 9

    start = 2
    while True:
        if k == 0:
            break
        print( start * 10 - 1)
        k -= 1
        start += 1

Submission status: Wrong Answer

Solution code:
# input
K = int(input())

count = 1

for i in range(1, 10):
    print(i)
    count += 1
    if count > K:
        break
while count <= K:
    print(9 + 10 * (count - 9))
    count += 1

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1,K+1): #1からKまで
    ansStr = ""
    ansStr += "9"*(i//9)
    if i%9 == 0:
        print(ansStr)
    else:
        print(str(i%9)+ansStr)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
base=list(map(str,[1,2,3,4,5,6,7,8,9]))
count=0
for i in range(math.ceil(n/9)):
    tmp=[]
    for k in base:
        print(k)
        count+=1
        if count==n:
            break
        tmp.append(k+"9")
    base=tmp

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def s(n):
    s_n = 0
    tmp = n

    while tmp > 0:
        s_n += tmp % 10
        tmp //= 10
    return s_n


k = int(input())

for i in range(1, k+1):
    if i < 10:
        print(i)
    else:
        j = i-9
        k = 10 ** (j//10)
        x = k * j + 9
        print(x)

Submission status: Wrong Answer

Solution code:
k = int(input())
if k < 10:
    print(k)
    exit()

print((k-8)*10-1)

# def s(n):
#     return sum(list(map(int, str(n))))
#
# l = []
# for i in range(1, 1010):
#     l.append([i, s(i), i/s(i)])
#
# l.sort(key=lambda x:x[2])
# for i in range(len(l)):
#     print(l[i])
#
# max = 0
# for i in range(len(l)):
#     if l[i][0] > max:
#         max = l[i][0]
#         print(l[i][0]+1, end=" ")
# print()

Submission status: Wrong Answer

Solution code:
def take_n_snuke(n):
    ret = []
    m = (n - 1) // 9
    for x in range(m + 1):
        for topdigit in range(1, 10):
            ret.append(str(topdigit) + '9' * x)
    return ret


K = int(input())

for elm in take_n_snuke(K)[:K]:
    print(elm)

#
# ls = reversed(ls)
#
# with open('abc101d.txt', 'w') as f:
#     for i in ls:
#         f.write('{}'.format(i))
#         f.write(',')

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(K):
	if i<9:
		print(i+1)
	else:
		p = int(i/9)
		r = (i%9)+1
		out = (r+1)*(10**p)-1
		print(out)

Submission status: Wrong Answer

Solution code:
# coding: utf-8


def s(n):
    s_n = 0
    tmp = n

    while tmp > 0:
        s_n += tmp % 10
        tmp //= 10
    return s_n


k = int(input())

for i in range(1, k+1):
    if i < 10:
        print(i)
    else:
        j = i-9
        x = 10 * j + 9
        if x/s(x) <= (x+10)/s(x+10):
            print(x)

Submission status: Wrong Answer

Solution code:
K = int(input())
now = 1
while K > 0:
    if now < 10:
        print(now)
        K -= 1
        if now == 9:
            now += 10
        else:
            now += 1
    else:
        print(now)
        K -= 1
        now += 10

Submission status: Wrong Answer

Solution code:
def S(n):
    return sum(map(int, list(str(n))))

k = int(input())
c = 0
i = 0
n = 0
while c < k:
    i += 1
    n += 1
    if n <= 9 or S(n) >= 10:
        print(n)
        c += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(k):
  ans = str(i % 9 + 1) + (i // 9) * '9'
  print(ans)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
  top_number = i % 9
  if top_number == 0:
    top_number = ''
  number_of_nine = int(i/9)
  number = str(top_number)+'9'*number_of_nine
  print(number)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(k):
    j = i + 1
    n = i // 9
    l = (j % 9)
    
    if n == 0:
        print(j)
    else:
        if l != 0:
            print(int(''.join([str(l)] + ['9' for _ in range(n)])))
        else:
            print(int(''.join(['9' for _ in range(n + 1)])))

Submission status: Wrong Answer

Solution code:
K = int(input())

def sunuke(n):
	return sum([int(k) for k in str(n)])

f = 0
num = 2
prev = 1
if K != 0:
	while f < K:
		k = sunuke(num) / num
		if k <= prev:
			print(num-1)
			f += 1
		prev = k
		num += 1

Submission status: Wrong Answer

Solution code:
k=int(input())

for i in range(k):
    c=i%9+1
    l=i//9
    print(str(c)+'9'*l)

Submission status: Wrong Answer

Solution code:
def S(str):
    tmp = 0
    for i in range(len(str)):
        tmp += int(str[i])
    return tmp

k = int(input())

count = 1
while k:
    if count*S(str(count+1)) <= (count+1)*S(str(count)):
        print(count)
        k -= 1
    count += 1

Submission status: Wrong Answer

Solution code:
def fun(key):
    L = len(str(key))
    if str(key)[0] == '9':
        return 1 * pow(10, L) + key
    else:
        return pow(10, L - 1) + key
K = int(input())
n = 9
for i in range(1, K + 1):
    if i < 10:
        print(i)
    else:
        n = fun(n)
        print(n)

Submission status: Wrong Answer

Solution code:
# coding: utf-8

k = int(input())

for i in range(k):
    if i < 9:
        print(i+1)
    else:
        j = i-8
        print(10 * j + 9)

Submission status: Wrong Answer

Solution code:
K = int(input())
for i in range(1, K + 1):
    cnt = i - 1
    tmp = i % 9
    if tmp == 0:
        tmp = 9
    while cnt >= 9:
            tmp = tmp * 10 + 9
            cnt -= 9
    print(tmp)

Submission status: Wrong Answer

Solution code:
K = int(input())

n = 1
k = 1
while k <= K:
    s1 = 0
    for n_i in str(n):
        s1 += int(n_i)
    x = n / s1

    m = n + 1
    s2 = 0
    for m_i in str(m):
        s2 += int(m_i)
    y = m / s2

    if x <= y:
        print(n)
        k += 1
    n += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
for i in range(K):
    if i < 9:
        print(i + 1)
    else:
        print(9 + 10 * (i - 8))

Submission status: Wrong Answer

Solution code:
N = int(input())

def S(n: int):
    str_n = list(str(n))
    num = 0
    for s in str_n:
        num += int(s)
    return num

def sunuke(n: int):
    Sn = S(n)
    return n / Sn

if N < 9:
    for i in range(N):
        print(i+1)
else:
    for i in range(9):
        print(i+1)
    i = 0
    while i + 10 <= N:
        print(9 + 10*(i+1))
        i += 1

Submission status: Wrong Answer

Solution code:
K = input()
n = int(K)
Sn = 0
for k in K:
    Sn += int(k)

npSn = n / Sn

if n < 10:
    for i in range(n):
        print(i+1)

else:
    for i in range(9):
        print(i+1)
    for i in range(n-9):
        print(9 + 10 * (i+1))

Submission status: Wrong Answer

Solution code:
import sys
K = int(raw_input())
for i in range(1, 10):
  if i > K:
    sys.exit(0)
  print i
j = 1
while j <= K-9:
  print str(j)+"9"
  j+=1

Submission status: Wrong Answer

Solution code:
K = int(input())

n = 0
S = [1, 2, 3, 4, 5, 6, 7, 8, 9]
while K > 0:
  if 9 <= K:
    for c in S:
      print("{}{}".format(c, "9" * n))
    n += 1
    K -= 9
  else:
    for c in S[:K]:
      print("{}{}".format(c, "9" * n))
    K = 0

Submission status: Wrong Answer

Solution code:
K = int(input())
base = K / sum(map(int, str(K)))
number = 0
n = 1
while number < K:
    if (n / sum(map(int, str(n)))) < base:
        print(n)
        number += 1

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 9:
        print(i+1)
    else:
        print((i-8)*10+9)

Submission status: Wrong Answer

Solution code:
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
def s(n):
	ans = 0
	for x in str(n):
		ans += int(x)
	return ans

k = int(input())
it = 0
i = 1
while it < k:
	if i < 10:
		print(i)
		i += 1
	elif i >= 10:
		if i == 10:
			i += 9
		else:
			i += 10
		print(i)
	it += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

cnt = 0

for i in range(k):
  n = '9' * i
  for j in range(1, 10):
    cnt += 1
    if cnt > k:
      exit()
    print(int(str(j) + n))

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 10:
        print(i+1)
    else:
        print((i-8)*10+9)

Submission status: Wrong Answer

Solution code:
k = int(input())
if k < 10:
    print(k)
    exit()

print(9 + (k-9)*10)

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 10:
        print(i)
    else:
        print((i-9)*10+9)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(k):
    j = i + 1
    if j <= 9:
        print(j)
    else:
        print(10 * (j - 9) + 9)

Submission status: Time Limit Exceeded

Solution code:
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
i=10
A=[1,2,3,4,5,6,7,8,9]
while len(A)<k:
   t=1
   i_list=list(str(i))
   i_len=len(i_list)
   import functools
   I=functools.reduce(lambda x,y:x+y,[int(k) for k in i_list])
   for j in range(len(i_list)):
       if (10**(i_len-1-j))*I<i:
           if int(i_list[j])!=9:
               t=0
   if t==1:
       A.append(i)
   i+=1
for i in range(k):
    print(A[i])

Submission status: Time Limit Exceeded

Solution code:
def S(n):
    k=list(str(n))
    import functools
    return functools.reduce(lambda x,y:x+y,[int(i) for i in k])
k=int(input())
def T(n):
    return n/S(n)
A=list()
i=0
import functools
while len(A)<k:
    i=i+1
    if i<10:
        A.append(i)
    else:
        I=list(str(i))
        j=int(I[0])*10**(len(I)-1)+functools.reduce(lambda x,y:x+y,[9*10**i for i in range(len(I)-1)])
        if i>=j:
            if T(i)<=T(i+1):
                A.append(i)
for i in A:
    print(i)

Submission status: Time Limit Exceeded

Solution code:
K = int(input())

P = [n for n in range(1, 10)]
Q = [n for n in range(1, 10)]
for d in range(20):
    if d < 8:
        for m in range(10, 100):
            P.append(int(str(m)+"9"*d))
            Q.append(m//10+m%10+9*d)
    else:
        for m in range(100, 1000):
            P.append(int(str(m)+"9"*(d-1)))
            Q.append(sum([int(s) for s in str(m)])+9*(d-1))

L = len(P)
c = 0
for i, (p, q) in enumerate(zip(P, Q)):
    ok = True
    for j in range(i+1, L):
        np, nq = P[j], Q[j]
        if np*q < nq*p:
            ok = False
            break
    if ok:
        print(p)
        c += 1
    if c == K:
        break


"""
import matplotlib.pyplot as plt

A = []
B = []
for n in range(-1+10**10, 10**15, 10**10):
    m = sum([int(s) for s in str(n)])
    A.append(n)
    B.append(n/m)


plt.plot(A, B)
plt.show()
"""