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())
i = 1
digit = 0

while(k > 0):
  tmp = i*10**(digit) + 10**(digit) - 1
  print(tmp)
  if(i == 9):
    i = 1
    digit += 1
  else:
    i += 1
  k -= 1

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 1
digit = 0

while(k >= 0):
  tmp = i*10**(digit) + 10**(digit) - 1
  print(tmp)
  if(i == 9):
    i = 0
    digit += 1
  else:
    i += 1
  k -= 1

Submission status: Wrong Answer

Solution code:
k = int(input())

c = 1
j = 0
for i in range(1, k + 1):
    if c % 10 == 0:
        c = 1
        j += 1
    print(str(c) + ("9" * j))
    c += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(0, k + 1):
    if (i + 1) % 10 == 0:
        continue
    c = i // 10
    print(str((i + 1) % 10) + ("9" * c))

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1, K+1):
    print(int(str((i-1)%9+1) + (((i-1)//9)*"9")))

Submission status: Wrong Answer

Solution code:
K = int(input())

def calc_sunuke(num):
    st = str(num)
    s_num = 0
    for c in st:
        s_num += int(c)
    return num / s_num

def search_sunuke(num):
    num_sunuke = calc_sunuke(num)
    if num >= 100:
        digits = len(str(num))
        for i in range(count + 10**(digits-2), 10**digits, 10**(digits-2)):
            if num_sunuke > calc_sunuke(i):
                return False
        return True
    else:
        for i in range(count+1, 100):
            if num_sunuke > calc_sunuke(i):
                return False
        return True



count = 1
sunuke_num = 0
while sunuke_num != K:
    if search_sunuke(count):
        print(count)
        sunuke_num += 1
    if count < 99:
        count += 1
    else:
        count_str = str(count)
        digits = len(count_str)
        r_count = count
        for c in count_str:
            if c != '9':
                count += 10**(digits - 2)
                break
        if r_count == count:
            count += 10**(digits - 1)

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(min(k, 9)):
    print(i+1)

if k>9:
    for i in range(k-9):
        print((i+1)*10+9)

Submission status: Wrong Answer

Solution code:
K = int(input())
if K <= 9:
    for i in range(K):
        print(i+1)
else:
    for i in range(9):
        print(i+1)
    a = K % 10
    b = K // 10
    for i in range(19, 10*(b*10+a+2), 10):
        print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
K = int(input())
for i in range(1,K+1):
    n = (10**(i//9))*(i%9+1)-1
    print(n)

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1,K+1):
    s = "9" * (i // 9)
    if i % 9 != 0:
        s += str(i%9)
    print(s[::-1])

Submission status: Wrong Answer

Solution code:
K = int(input())

if(K<10):
    for i in range(K):
        print(i+1)
else:
    cnt = 0
    sunuke = 19
    # 1~9
    for i in range(1,10):
        print(i)
    # 19~K
    while cnt != K-9:
        print(sunuke)
        sunuke += 10
        cnt += 1

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[]
for i in range(1,10): #1桁の数
  ans.append(str(i))
  
for i in range(1,10): #2桁の数
  ans.append(str(i)+'9')
  
for i in range(1,10): #3桁の数
  ans.append(str(i)+'99')
  
for i in range(10): #4桁の数
  ans.append('1'+str(i)+'99')
for i in range(2,10): #4桁の数
  ans.append(str(i)+'999')
  
for i in range(1,3): #5桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999')
for i in range(3,10): #5桁の数
  ans.append(str(i)+'9999')
  
for i in range(1,4): #6桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999')
for i in range(4,10): #6桁の数
  ans.append(str(i)+'99999')
  
for i in range(1,5): #7桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999')
for i in range(5,10): #7桁の数
  ans.append(str(i)+'999999')

for i in range(1,6): #8桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999')
for i in range(6,10): #8桁の数
  ans.append(str(i)+'9999999')
  
for i in range(1,7): #9桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999')
for i in range(7,10): #9桁の数
  ans.append(str(i)+'99999999')

for i in range(1,8): #10桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999')
for i in range(8,10): #10桁の数
  ans.append(str(i)+'999999999')

for i in range(1,9): #11桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999')
for i in range(9,10): #11桁の数
  ans.append(str(i)+'9999999999')
  
for i in range(1,10): #12桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999999')
for i in range(10,10): #12桁の数
  ans.append(str(i)+'99999999999')

for i in range(1,10): #13桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999')
for i in range(10,10): #13桁の数
  ans.append(str(i)+'999999999999')
  
for i in range(1,10): #14桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999999')
for i in range(10,10): #14桁の数
  ans.append(str(i)+'9999999999999')

for i in range(10): #15桁の数
  ans.append('10'+str(i)+'999999999999')
for i in range(1,10): #15桁の数
  ans.append('1'+str(i)+'9999999999999')
for i in range(2,10): #15桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999999')
  
for val in ans[:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[]
for i in range(1,10): #1桁の数
  ans.append(str(i))
  
for i in range(1,10): #2桁の数
  ans.append(str(i)+'9')
  
for i in range(1,10): #3桁の数
  ans.append(str(i)+'99')
  
for i in range(10): #4桁の数
  ans.append('1'+str(i)+'99')
for i in range(2,10): #4桁の数
  ans.append(str(i)+'999')
  
for i in range(1,3): #5桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999')
for i in range(3,10): #5桁の数
  ans.append(str(i)+'9999')
  
for i in range(1,4): #6桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999')
for i in range(4,10): #6桁の数
  ans.append(str(i)+'99999')
  
for i in range(1,5): #7桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999')
for i in range(5,10): #7桁の数
  ans.append(str(i)+'999999')

for i in range(1,6): #8桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999')
for i in range(6,10): #8桁の数
  ans.append(str(i)+'9999999')
  
for i in range(1,7): #9桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999')
for i in range(7,10): #9桁の数
  ans.append(str(i)+'99999999')

for i in range(1,8): #10桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999')
for i in range(8,10): #10桁の数
  ans.append(str(i)+'999999999')

for i in range(1,9): #11桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999')
for i in range(9,10): #11桁の数
  ans.append(str(i)+'9999999999')
  
for i in range(1,10): #12桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999999')
for i in range(10,10): #12桁の数
  ans.append(str(i)+'99999999999')

for i in range(1,10): #13桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999')
for i in range(10,10): #13桁の数
  ans.append(str(i)+'999999999999')
  
for i in range(1,10): #14桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999999')
for i in range(10,10): #14桁の数
  ans.append(str(i)+'9999999999999')

for i in range(10): #15桁の数
  ans.append('10'+str(i)+'999999999999')
for i in range(1,10): #15桁の数
  ans.append('1'+str(i)+'9999999999999')
for i in range(2,10): #15桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999999')
  
for val in ans[300:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[]
for i in range(1,10): #1桁の数
  ans.append(str(i))
  
for i in range(1,10): #2桁の数
  ans.append(str(i)+'9')
  
for i in range(1,10): #3桁の数
  ans.append(str(i)+'99')
  
for i in range(10): #4桁の数
  ans.append('1'+str(i)+'99')
for i in range(2,10): #4桁の数
  ans.append(str(i)+'999')
  
for i in range(1,3): #5桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999')
for i in range(3,10): #5桁の数
  ans.append(str(i)+'9999')
  
for i in range(1,4): #6桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999')
for i in range(4,10): #6桁の数
  ans.append(str(i)+'99999')
  
for i in range(1,5): #7桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999')
for i in range(5,10): #7桁の数
  ans.append(str(i)+'999999')

for i in range(1,6): #8桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999')
for i in range(6,10): #8桁の数
  ans.append(str(i)+'9999999')
  
for i in range(1,7): #9桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999')
for i in range(7,10): #9桁の数
  ans.append(str(i)+'99999999')

for i in range(1,8): #10桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999')
for i in range(8,10): #10桁の数
  ans.append(str(i)+'999999999')

for i in range(1,9): #11桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999')
for i in range(9,10): #11桁の数
  ans.append(str(i)+'9999999999')
  
for i in range(1,10): #12桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999999')
for i in range(10,10): #12桁の数
  ans.append(str(i)+'99999999999')

for i in range(1,10): #13桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999')
for i in range(10,10): #13桁の数
  ans.append(str(i)+'999999999999')
  
for i in range(1,10): #14桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999999')
for i in range(10,10): #14桁の数
  ans.append(str(i)+'9999999999999')

for i in range(10): #15桁の数
  ans.append('10'+str(i)+'999999999999')
for i in range(1,10): #15桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999999')
  
for val in ans[300:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[]
for i in range(1,10): #1桁の数
  ans.append(str(i))
  
for i in range(1,10): #2桁の数
  ans.append(str(i)+'9')
  
for i in range(1,10): #3桁の数
  ans.append(str(i)+'99')
  
for i in range(10): #4桁の数
  ans.append('1'+str(i)+'99')
for i in range(2,10): #4桁の数
  ans.append(str(i)+'999')
  
for i in range(1,3): #5桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999')
for i in range(3,10): #5桁の数
  ans.append(str(i)+'9999')
  
for i in range(1,4): #6桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999')
for i in range(4,10): #6桁の数
  ans.append(str(i)+'99999')
  
for i in range(1,5): #7桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999')
for i in range(5,10): #7桁の数
  ans.append(str(i)+'999999')

for i in range(1,6): #8桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999')
for i in range(6,10): #8桁の数
  ans.append(str(i)+'9999999')
  
for i in range(1,7): #9桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999')
for i in range(7,10): #9桁の数
  ans.append(str(i)+'99999999')

for i in range(1,8): #10桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999')
for i in range(8,10): #10桁の数
  ans.append(str(i)+'999999999')

for i in range(1,9): #11桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999')
for i in range(9,10): #11桁の数
  ans.append(str(i)+'9999999999')
  
for i in range(1,10): #12桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999999')
for i in range(10,10): #12桁の数
  ans.append(str(i)+'99999999999')

for i in range(1,10): #13桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'99999999999')
for i in range(10,10): #13桁の数
  ans.append(str(i)+'999999999999')
  
for i in range(1,10): #14桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'999999999999')
for i in range(10,10): #14桁の数
  ans.append(str(i)+'9999999999999')
  
for i in range(1,10): #15桁の数
  for j in range(10):
    ans.append(str(i)+str(j)+'9999999999999')
for i in range(10,10): #15桁の数
  ans.append(str(i)+'99999999999999')
  
for val in ans[:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[]
for i in range(1,10):
  ans.append(str(i))
for i in range(1,10):
  ans.append(str(i)+'9')
for i in range(1,100000):
    ans.append(str(i)+'99')
for val in ans[:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=['1','2','3','4','5','6','7','8','9']
for i in range(1,21):
  for j in range(1,10):
    ans.append(str(j)+'9'*i)
for val in ans[:k]:
  print(val)

Submission status: Wrong Answer

Solution code:
a  = input()
for i in range(1, int(a) + 1):
    if (i < 10):
        print (i)
    else:
        z = 9 - (i % 10)
        y = int(i / 10) * 10
        print (int(y + z))

Submission status: Wrong Answer

Solution code:
a  = input()
for i in range(1, int(a) + 1):
    if (i < 10):
        print (i)
    else:
        z = 10 - (i % 10) - 1
        y = i / 10 * 10
        print (int(y + z))

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

lines = sys.stdin.readlines()

k = int(lines[0])

snk1 = 1
snk2 = 1
count = 0
i = 2
while count < k:
    snk2 = sum(int(d) for d in str(i))
    snk2 = (i / snk2)
    if snk1 <= snk2:
        print (i - 1)
        count += 1
    snk1 = snk2
    i += 1

Submission status: Wrong Answer

Solution code:
import os, sys, re, math

lines = sys.stdin.readlines()

k = int(lines[0])

snk1 = 1
snk2 = 1
count = 0
i = 2
while count < k:
    snk2 = sum(int(d) for d in str(i))
    if ((i - 1) / snk1) <= (i / snk2):
        print (i - 1)
        count += 1
    snk1 = snk2
    i += 1

Submission status: Wrong Answer

Solution code:
n = int(input())
for i in range(n):
    print(str((i % 9) + 1)  + '9' * (i // 9))

Submission status: Wrong Answer

Solution code:
from heapq import *
def snu(n):
    s=str(n)
    kei=sum(int(x) for x in s)
    return n/kei
k=int(input())
hp=[]
t=9 if k>9 else k
for i in range(1,t+1):
    print(i)
if k<=9:exit()
for i in range(1,15):
    n=10**i+9
    heappush(hp,[n/10,n])
ans=[]
for _ in range(k-9):
    s,n=heappop(hp)
    print(n)
#    ans.append([s,n])
    iti=n%10
    if iti==9:
        heappush(hp,[snu(n+10),n+10])
        heappush(hp, [snu(n-1), n-1])
    elif iti>0:
        heappush(hp, [snu(n - 1), n - 1])

Submission status: Wrong Answer

Solution code:
import statistics
import math
N = int( input())

for i in range(1,10):
    print(i)
    N -= 1
    if N == 0:
        break
i = 1
while N > 0:
    print(str(i) + "9")
    N -=1

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    m = defaultdict(lambda : None)
    def s(n):
        if m[n] != None:
            return m[n]
        res = 0
        k = n
        while n:
            res += n%10
            n //= 10
        m[n] = k/res
        return m[n]
    k = I()
    ans = []
    d = 1
    l = [i+1 for i in range(9999)]
    while len(ans) < k:
        n = d-1
        for i in range(9999):
            x = n+d*l[i]
            if s(x) <= s(x+d):
                ans.append(x)
        d *= 10000
    for i in ans[:k]:
        print(i)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    m = defaultdict(lambda : None)
    def s(n):
        if m[n] != None:
            return m[n]
        res = 0
        k = n
        while n:
            res += n%10
            n //= 10
        m[n] = k/res
        return m[n]
    k = I()
    ans = []
    d = 1
    l = [i+1 for i in range(99)]
    while len(ans) < k:
        n = d-1
        for i in range(99):
            x = n+d*l[i]
            if s(x) <= s(x+d):
                ans.append(x)
        d *= 100
    for i in ans[:k]:
        print(i)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Wrong Answer

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LS():return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = I()
    return l
def LIR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = LI()
    return l
def SR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = S()
    return l
def LSR(n):
    l = [None for i in range(n)]
    for i in range(n):l[i] = SR()
    return l
sys.setrecursionlimit(1000000)
mod = 1000000007

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    m = defaultdict(lambda : None)
    def s(n):
        if m[n] != None:
            return m[n]
        res = 0
        k = n
        while n:
            res += n%10
            n //= 10
        m[n] = k/res
        return m[n]
    k = I()
    ans = []
    d = 1
    l = [i for i in range(100)]
    while len(ans) < k:
        n = d-1
        for i in range(100):
            x = n+d*i
            if not x:continue
            if s(x) <= s(x+d):
                ans.append(x)
        d *= 100
    for i in ans[:k]:
        print(i)
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

#Solve
if __name__ == "__main__":
    D()

Submission status: Wrong Answer

Solution code:
K = int(input())

def minSunuke(n) :  # n以上の n/S(n) の最小値
    sumDigit = sum(map(int, list(str(n))))
    return n // sumDigit

digit = 0
now = 1

for i in range(K) :
    print(now)
    if minSunuke(now + 10**digit) > minSunuke(now + 10**(digit + 1)) :
        digit += 1
    now += 10**digit

Submission status: Wrong Answer

Solution code:
def get_sum(n):
    s = 0
    while True:
        s += n%10
        n = n//10
        if n == 0:
            break
    return s


K = int(input())    

N = 1
M = 2
cnt = 0
while True:    
    sumM = get_sum(M)
    for n in range(N, M):
        if n * sumM <= M * get_sum(n):
            print(n)
            cnt += 1

        if cnt == K:
            break
    if cnt == K:
        break
    N += 1
    M += 1

Submission status: Wrong Answer

Solution code:
def get_sum(n):
    s = 0
    while True:
        s += n%10
        n = n//10
        if n == 0:
            break
    return s


K = int(input())    

n = 1
m = 2
cnt = 0
while True:
    if n * get_sum(m) <= m * get_sum(n):
        print(n)
        cnt += 1
    
    if cnt == K:
        break
    n += 1
    m += 1

Submission status: Wrong Answer

Solution code:
ans = [i for i in range(1,10)]
L1= [10*i+9 for i in range(1,11)]
ans += L1
L2 = [int(str(9)*i) for i in range(3,16)]
ans += L2
print(ans[:int(input())])

Submission status: Wrong Answer

Solution code:
def Sunuke(n):
    x = n % 9
    y = (n-x)/9
    if n <= 27:
        ans = (10**y)*(x+1) - 1
    else:
        if x == 0:
            ans = 999 + 1000*(y-3)
        else:
            ans = 99 + 100*x + 1000*(y-2)
    return ans

K = int(input())
for i in range(K):
    print(int(Sunuke(i+1)))

Submission status: Wrong Answer

Solution code:
def Sunuke(n):
    x = n % 9
    y = (n-x)/9
    ans = (10**y)*(x+1) - 1
    return ans

K = int(input())
for i in range(K):
    print(int(Sunuke(i+1)))

Submission status: Wrong Answer

Solution code:
N=int(input())

for i in range(N):
    a=str((i%9)+1)
    b=i
    while b>=9:
        a+="9"
        b-=9
    print(a)

Submission status: Wrong Answer

Solution code:
N=int(input())

for i in range(N):
    a=str((i%9)+1)
    b=i
    while b>=9:
        a+="9"
        b//=9
    print(a)

Submission status: Wrong Answer

Solution code:
k=int(input())
def s(n):
    m=str(n)
    l=list(m)
    l=map(int,l)
    return n/sum(l)
tmp=1
l=[]
for i in range(k*2):
    if i<9:
        l.append([1,i+1])
    else:
        l.append([9+s(tmp),tmp*10+9])
        tmp+=1
l.sort()
for i in range(k):
    print(l[i][1])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())

snuke = 0
for i in range(k):
    snuke += 10**(i//9)
    print(snuke)

Submission status: Wrong Answer

Solution code:
k = int(input())

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

Submission status: Wrong Answer

Solution code:
K = int(input())

counter = 0

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

    if counter == K:
        break

if K >= 10:
    a = 10
    while True:
        print(a + 9)
        counter += 1

        if counter == K:
            break
        else:
            a += 10

Submission status: Wrong Answer

Solution code:
k = int(input())

if k <= 9:
    for i in range(1,k+1):
        print(i)

else:
    for i in range(1,10):
        print(i)
    s = '1'
    for i in range(k-9):
        s += '9'
        print(int(s))

Submission status: Wrong Answer

Solution code:
"""
nを10進法で表したときの各桁の和をS(n)
S(123) = 1+2+3 = 6
m<nの時、n/S(n) < m/S(m)になるのをすぬけ数

2桁
M = 10*a+b/a+b = 1 + 9a/a+b 　  aが固定だと、bが大きいほど、Mは小さい
  = 10 - 9b/a+b                 b固定だと、aが大きいほどMは大きい

1桁 1,...,9        9個
2桁 19,..,99       9個
3桁 199,...,999    9個
4桁 1999,....,9999 9個

9
18
27
36
"""

K = int(input())
cnt = 0
index = 0

for i in range(1,K+1):
    a = i // 9
    b = i %  9
    print(b*10**a+10**a-1)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())
counter = 0
nine_num = 0
while counter < K:
    for i in range(1, 10):
        print(str(i)+"9"*nine_num)
        counter += 1
        if counter >= K:
            break
    nine_num += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

cand = []
cand.extend(range(1, 10))
for i in range(1, 16):
  cand.extend([(10**i)*(j+1)-1 for j in range(1,10)])
  
#print(cand)
for ans in cand[0:k]:
  print(ans)

Submission status: Wrong Answer

Solution code:
k = int(input())

cand = []
cand.extend(range(1, 10))
for i in range(1, 16):
  cand.extend([(10**i)*(j+1)-1 for j in range(1,10)])
  
#print(cand)
print(cand[0:k])

Submission status: Wrong Answer

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

def list_to_num(l):
    s = 0
    for i in range(len(l)):
        s += l[i]*pow(10,i)
    return s

k = int(input())

def func(a):
    n = a+1
    if a == 0:
        return 1
    elif n/digitsum(n)==1:
        return n
    else:
        n = n-1
        s = str(n)
        array = list(map(int, s))[::-1]
        if len(list(set(array)))==1 and list(set(array))[0]==9:
            n =list_to_num(array)+1
            s = str(n)
            array = list(map(int, s))[::-1]
        min = pow(10,15)
        ans = 0
        for i in range(len(array)):
            for j in range(array[i]+1,10):
                array[i] = j
                temp = list_to_num(array)/digitsum(list_to_num(array))
                if temp < min:
                    min = temp
                    ans = list_to_num(array)
        return ans


n = 0
for i in range(k):
    print(func(n))
    n = func(n)

Submission status: Wrong Answer

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

def list_to_num(l):
    s = 0
    for i in range(len(l)):
        s += l[i]*pow(10,i)
    return s



k = int(input())

def func(a):
    n = a+1
    if a==0:
        return 1
    elif n/digitsum(n) == 1:
        return n
    else:
        s = str(n)
        array = list(map(int, s))[::-1]
        if len(list(set(array)))==1 and list(set(array))[0] == 9:
            return pow(10,len(array))+9
        else:
            for i in range(len(array)):
                if int(i) != 9:
                    array[0] = 9
                    break
            return list_to_num(array)


n = 0
for i in range(k):
    print(func(n))
    n = func(n)

Submission status: Wrong Answer

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

def list_to_num(l):
    s = 0
    for i in range(len(l)):
        s += l[i]*pow(10,i)
    return s



k = int(input())

def func(n):
    if n/digitsum(n) == 1:
        return n
    else:
        s = str(n)
        array = list(map(int, s))[::-1]
        if len(list(set(array)))==1 and list(set(array))[0] == 9:
            return pow(10,len(array))+9
        else:
            for i in range(len(array)):
                if int(i) != 9:
                    array[0] = 9
                    break
            return list_to_num(array)


for i in range(1,k+1):
    print(func(i))

Submission status: Wrong Answer

Solution code:
K=int(input())
tmp=0
i=1
k=0
while(True):
  if k==K:
    break
  print(i*(10**tmp)+(10**tmp-1))
  k+=1
  i+=1
  if i==10:
    i=1
    tmp+=1

Submission status: Wrong Answer

Solution code:
N = int(input())
for i in range(1,N+1):
    if(i<10):
        print(i)
    else:
        print(int(str(i%9)+'9'*(i//9)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())
count = 0
while True:
    ans = []
    count += 1
    if count == k+1:
        break
    if count%9!=0:
        ans.append(str(count%9))
    else:
        ans.append('9')
    digit = (count-1)//9
    for i in range(digit):
        ans.append('9')
    print(''.join(ans))

Submission status: Wrong Answer

Solution code:
k = int(input())

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

# 9まで
if k < 10:
    for i in range(k):
        print(i+1)
# 10から
else:
    print("1\n2\n3\n4\n5\n6\n7\n8\n9")
    n = 19
    i = 10
    while i <= k and n <=pow(10,15):
        if digits(n) > 9 and n%10==9:
            print(n)
            i += 1
        n += 10

Submission status: Wrong Answer

Solution code:
K=int(input())
for k in range(1,K+1):
  if k/9<=1:
    print(k)
  else:
    print(int("".join(list(map(str,[(k%9),]+[9,]*int((k/9))
                              )
                          )
                     )
             )
         )

Submission status: Wrong Answer

Solution code:
k = int(input())

def digits(n):
    if n < 10:
        return n
    else:
        return n%10 + digits(int(n/10))

# 9まで
if k < 10:
    for i in range(k):
        print(i+1)
# 10から
else:
    print("1\n2\n3\n4\n5\n6\n7\n8\n9")
    n = 19
    i = 10
    while i <= k and n <=pow(10,15):
        if digits(n) > 9:
            print(n)
            i += 1
        n += 1

Submission status: Wrong Answer

Solution code:
k = int(input())
sho = k // 9
amari = k % 9
for i in range(sho):
  for j in range(9):
    print(int(str(j+1) + "9"*i))
for j in range(amari):
  print(int(str(j+1) + "9"*sho))

Submission status: Wrong Answer

Solution code:
K = int(input())

ans = 0
k = 100
c = 0
for i in range(K):
    if c == 19 + 9*(len(str(k))-3):
        c = 0
        k *= 10
    if i < 9:
        ans += 1
    elif i < 18:
        ans += 10
    else:
        ans += k
        c += 1
    print(ans)

Submission status: Wrong Answer

Solution code:
K = int(input())
for i in range(K):
    print(int(str((i + 1) % 9) + '9' * ((i + 1) // 9)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys

def S(n):
    res = 0
    while n > 0:
        res += (n%10)
        n //= 10
    return res

def f(n):
    return n / S(n)

def solve(K: int):

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

        c = 19
        while k > 0:
            print(c)
            c += 10
            k -= 1




    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    solve(K)

if __name__ == '__main__':
    main()