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:
from itertools import chain, count, islice

def f():
    j = int(input())
    cs = '123456789'
    xs = ['123456789', (c+'9' for c in cs)] 
    for x in chain(*xs):
        if j == 0: return
        yield x
        j -= 1

    for i in count(2):
        for n in range(i-1, i*10-1):
            if j == 0: return
            yield str(n)+('9'*i)
            j -= 1

z = list(f())

Submission status: Wrong Answer

Solution code:
k = int(input())
cnt = 9

for i in range(1,9):
    print(i)
for i in range(10,1000000000000000000000):
    if cnt == k:
        break
    s = str(i)
    if s[len(s)-1] == '9':
        print(i)
        cnt = cnt + 1

Submission status: Wrong Answer

Solution code:
#coding:utf-8
K = int(input())
ten = K // 10
sur = K % 10
for i in range(ten+1):
    if i == ten:
        for j in range(1, sur+1):
            moji = "{}".format(j) + "9" * i
            print(moji)
    else:
        for j in range(1,10):
            moji = "{}".format(j) + "9" * i
            print(moji)

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[1,2,3,4,5,6,7,8,9]
i=1
j=1
l=0
snuke=9
num=9
while len(ans)<k:
    snuke+=10**i
    ans.append(snuke)
    if snuke//(10**i)==num:
        num+=10**j
        i+=1
        l+=1
        if l==9:
            j=2
for i in range(k):
    print(ans[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)
    x=k-9
    for j in range(x):
        print((j+1)*10+9)

Submission status: Wrong Answer

Solution code:
K = int(input())

end_flg = 0
for i in range(15):
    # 桁ごとに出力
    for j in range(1, 10):
#        print({end_flg: (10 ** i - 1) + j * 10 ** i})
        print((10 ** i - 1) + j * 10 ** i)
        end_flg += 1
        if end_flg == K:
            break
    if end_flg == K:
        break

while end_flg < K:
    print(10 ** 15)
    end_flg += 1

Submission status: Wrong Answer

Solution code:
K = input()
h = int(K)
i = 0


num = 1
while h > 0:

    i += num
    if i >= 9: num = 10
    if i >= 99: num = 100
    if i >= 999: num = 1000
    if i >= 9999: num = 10000
    if i >= 99999: num = 100000
    if i >= 999999: num = 1000000
    if i >= 9999999: num = 10000000
    if i >= 99999999: num = 100000000
    if i >= 999999999: num = 1000000000
    if i >= 9999999999: num = 10000000000
    if i >= 99999999999: num = 100000000000
    if i >= 999999999999: num = 1000000000000
    if i >= 9999999999999: num = 10000000000000
    if i >= 99999999999999: num = 100000000000000
    if i >= 999999999999999: num = 1000000000000000

    print(i)
    h -= 1

Submission status: Wrong Answer

Solution code:
def digitsums(N):
    digsum = 0
    for i in range(len(str(N))):
        digsum = digsum + int(N % 10)
        N = N / 10
    return digsum
K = int(input())
pcount=0
for n in range(1,10**15):
    for m in range(n+1,10**15):
        if(n/digitsums(n)<=m/digitsums(m)):
            pcount = pcount+1
            print(n)
            break
    if(pcount>=K):
        break

Submission status: Wrong Answer

Solution code:
K=int(input())

count=0
n=0
zouka=1

while count<K and n<=10**15:
    n+=zouka
    if n>10**15:
        break
    if str(n)[0:1]=="9":
        zouka=zouka*10
    print(n)
    
    count+=1

Submission status: Wrong Answer

Solution code:
K=input()


def judge(n):
	S=list(str(n))
	a=sum(map(int,S))
	if a%10==0:
		return True
	else:
		return False

cnt=0
for i in range(1,10**3):
	if i<=9:
		print i
		cnt+=1
	else:
		if judge(i):
			print i
			cnt+=1
	if cnt==K:
		quit()

Submission status: Wrong Answer

Solution code:


import numpy as np

def ii():
    return int(input())


def lii():
    return list(map(int, input().split(' ')))


def lvi(N):
    l = []
    for _ in range(N):
        l.append(ii())
    return l


def lv(N):
    l = []
    for _ in range(N):
        l.append(input())
    return l


#a = map(int, input().split())


k = ii()

iter = 1
ans = 0

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

    ans = ans + iter

    print( ans)

    if( i % 9 == 0):
        iter *= 10

Submission status: Wrong Answer

Solution code:
# coding : utf-8

K = int(input())

Sunuke = [1, 2, 3, 4, 5, 6, 7, 8, 9]

# 10以上は、1の位が9の数がすぬけ数となる
if K <= len(Sunuke):
    for i in range(K):
        print(Sunuke[i])

else:
    resi = K - len(Sunuke)
    digit = 1
    num = 19
    Sunuke.append(num)
    resi -= 1
    endFlg = False
    while resi > 0:
        for d in range(1, digit+1):
            for i in range(9):
                num += 10
                Sunuke.append(num)

                resi -= 1
                if resi == 0:
                    endFlg = True
                    break
            if endFlg:
                break

for i in range(K):
    print(Sunuke[i])

Submission status: Wrong Answer

Solution code:
K = int(input())

if K < 10:
    for i in range(1,K+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    count = 9
    while True:
        for i in range(1,16):
            for j in range(1,11):
                print(int(str(j)+"9"*i))
                count += 1
                if count >= K: exit()

Submission status: Wrong Answer

Solution code:
N=int(input())
if N <10:
    for i in range (N):
        print (i+1)
else:
    for i in range (9):
         print (i+1)
    count=2
    for j in range (N-9):
        if j ==0:
            print (19)
        elif j ==1:
            print(199)
        else:
            print( int(str(1)+str(0)*1+count*str(9)))
            count+=1
if N==23:
    print (10**15)

Submission status: Wrong Answer

Solution code:
K=int(input())
c=1
while K and c<60:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*5,sep='')
    K-=1
    c+=1
c=65
while K and c<70:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*6,sep='')
    K-=1
    c+=1
c=75
while K and c<80:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*7,sep='')
    K-=1
    c+=1
c=85
while K and c<90:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*8,sep='')
    K-=1
    c+=1
c=95
while K and c<100:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*9,sep='')
    K-=1
    c+=1
c=105
while K and c<110:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*10,sep='')
    K-=1
    c+=1
c=115
while K and c<120:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*11,sep='')
    K-=1
    c+=1
c=125
while K and c<130:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*12,sep='')
    K-=1
    c+=1
c=135
while K and c<140:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*13,sep='')
    K-=1
    c+=1
c=145
while K and c<150:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
while K and c<50:
    print(c,'9'*14,sep='')
    K-=1
    c+=1
c=155
while K and c<160:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1

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(2, pow(10, 15) + 1):
	if (i - 1) / digit_sum(i-1) <= (i / digit_sum(i)):
		Sn.append(i - 1)
	if len(Sn) >= K:
		break
for i in range(len(Sn)):
	print(Sn[i])

Submission status: Wrong Answer

Solution code:
def d_snuke_numbers(K):
    candidate = []
    for k in range(15):
        if k <= 2:
            tmp = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
        else:
            tmp = ['10', '11', '12', '13', '14', '15', '16', '17', '18',
                   '19', '20', '29', '39', '49', '59', '69', '79', '89', '99']
        for l in tmp:
            if k <= 2:
                candidate.append(str(l)+str(9)*k)
            else:
                candidate.append(str(l)+str(9)*(k-1))
    ans = '\n'.join(candidate[:K])
    return ans

K = int(input())
print(d_snuke_numbers(K))

Submission status: Wrong Answer

Solution code:
import numpy as np

def kyuu(i):
    su = 0
    for k in range(i):
        su += 10**k * 9
    return su

K = int(input())
b = []
i = 0
for k in range(1,10):
    b.append(10 ** i * k + kyuu(i))

i = 1
for k in range(i,10):
    b.append(10 ** i* k + kyuu(i))
    
en = 0
for i in range(2,100000):
    for k in range(i - 1,i * 10):
        b.append(10**i *k + kyuu(i))
        if len(b) > K:
            en = 1
            break
    if en == 1:
        break
for bb in b[:K]:
    print(bb)

Submission status: Wrong Answer

Solution code:
K = input()
h = int(K)
i = 0


num = 1
while h > 0:

    i += num
    if i >= 9: num = 10
    if i >= 99: num = 100
    if i >= 999: num = 1000
    if i >= 9999: num = 10000
    if i >= 99999: num = 100000
    if i >= 999999: num = 1000000
    if i >= 9999999: num = 10000000
    if i >= 99999999: num = 100000000
    if i >= 999999999: num = 1000000000
    if i >= 9999999999: num = 10000000000
    if i >= 99999999999: num = 100000000000
    if i >= 999999999999: num = 1000000000000
    if i >= 9999999999999: num = 10000000000000
    if i >= 99999999999999: num = 100000000000000

    print(i)
    h -= 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K=int(input())
a=[]
for j in range(1,K):
    for i_j in range(1,10):
        a.append((i_j)*10**(j-1) + 10**(j-1) - 1)
for k in range(K):
    if a[k]<= 10**15:
        print(a[k])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-

K = int(input())

if K <= 0:
    exit()

out = 0
i = 1
while True:

    if 1 <= i <= 9 or (i >= 10 and i % 10 == 9): 
        print(i)
        out += 1
        if out == K:
            exit()
    i += 1

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 15, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if n > 100000000000000:
        break
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

Solution code:
k=int(input())
count=0
for i in range(14):
  for j in range(1,10):
    print(j*(10**i))
    count+=1
    if count==k:
      break
  if count==k:
    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))))):
        print(num)
        num += 1
        ans += 1
    else:
        num += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
kyu = ""
c = 0
e = 1
while c < K and int(str(e) + kyu) <= 10**15:
    while e < 10 and c < K and int(str(e) + kyu) <= 10**15:
        print(int(str(e) + kyu))
        c += 1
        e += 1
    e = 1
    kyu += "9"

Submission status: Wrong Answer

Solution code:
K = int(input())

loop = 0

while(K >= 9):
  for i in range(2,11):
  	print((10**loop)*i-1)
  loop += 1
  K -= 9

j = 2
while(K > 0):
  print((10**loop)*j-1)
  # print((10**15)*j-1)
  K -= 1
  j += 1

Submission status: Wrong Answer

Solution code:
K = int(input())

end_flg = 0
for i in range(15):
    # 桁ごとに出力
    for j in range(1, 10):
#        print({end_flg: (10 ** i - 1) + j * 10 ** i})
        print((10 ** i - 1) + j * 10 ** i)
        end_flg += 1
        if end_flg == K:
            break
    if end_flg == K:
        break

if end_flg < K:
    print(10 ** 15)

Submission status: Wrong Answer

Solution code:
K = int(input())

if K < 10:
    for i in range(1,K+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    count = 9
    while True:
        for i in range(1,16):
            for j in range(1,10):
                print(int(str(j)+"9"*i))
                count += 1
                if count >= K: exit()

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 1000, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if n > 100000000000000:
        break
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

Solution code:
k = int(input())

if k <= 9:
    for i in range(k):
        print(i+1)
else :
    s = ['1', '2', '3', '4', '5', '6', '7', '8', '9']
        
    nines = ''
    cnt = 0
    while cnt < k:
        for i in range(9):
            print(s[i]+nines)
            cnt += 1
            if cnt >= k:
                break
        nines += '9'
        if len(nines) == 15:
            break

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    K = int(input())
    s = [1, 2, 3, 4, 5, 6, 7, 8, 9]

    if K > 9:
        for i, j in enumerate(range(K-9)):
            s.append((i+1)*10 + 9)

    for i in s:
        print(i)

Submission status: Wrong Answer

Solution code:
K=int(input())
count=0

l =[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
l2=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]
for i in range(K):
    l.append(int(str(l2[i%18])+"9"*(i//18 +1)))

for i in range(K):
    print(l[i])

Submission status: Wrong Answer

Solution code:
K = int(input().strip())
loop, mod = divmod(K, 9)
for i in range(1, min(10, K+1)):
    print(i)
for i in range(1, loop):
    for j in range(2, 10):
        print(j*10**i-1)
if(loop != 0):
    for j in range(1, mod+2):
        print(j*10**(loop)-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)
    elif i < 19:
        k = 10 ** (i//10)
        x = k * ((i+1) % 10) + k - 1
        print(x)
    else:
        j = (i+1 - 20) % 90
        m = (i+1 - 20) // 90
        k = 10 ** (m + 1)
        l = 10 ** (m + 2)
        x = l + k * (j + 1) - 1
        print(x)

Submission status: Wrong Answer

Solution code:
k = int(input())

ans = []

k_i = k // 9
k_j = k % 9

for i in range(k_i):
    if i == 0:
        for j in range(9):
            ans.append(j+1)
    else:
        for j in range(9):
            ans.append((10**i)*(j+2) - 1)

for i in range(k_j):
    ans.append((10**(k_i))*(i+2) - 1)

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

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 1000, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

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
totalsum = 10
for i in range(1, int(1e15)):
	if i < 10:
		print(i)
		it += 1
	else:
		if i%9 == 1:
			if i < 199:
				totalsum = 10
			elif i < 1000:
				totalsum = 19
			elif i < 2000:
				totalsum = 28
			elif i < 20000:
				totalsum = 37
			elif i < 200000:
				totalsum = 46
			if s(i) == totalsum:
				# print(i, s(i), i/s(i))
				print(i)
				it += 1
	if it == k:
		break

Submission status: Wrong Answer

Solution code:
K = int(input())
a = [1]
while 1:
    big = a[-1]
    if len(str(big)) == len(str(big + 1)):
        a.append(big + 10**(len(str(big))-1))
    else:
        a.append(big + 10**(len(str(big))))
    if len(a) == K:
        break

for i in a:
    print(i)

Submission status: Wrong Answer

Solution code:
from itertools import chain, count, islice

def f():
    j = int(input())
    cs = '123456789'
    xs = ['123456789', (c+'9' for c in cs)] 
    for x in chain(*xs):
        if j == 0: return
        print(x)
        j -= 1

    for i in range(2, 10):
        for n in range(i-1, i*10-1):
            if j == 0: return
            print(int(str(n)+('9'*i)))
            j -= 1

f()

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 500, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

Solution code:
def main():
    K = int(input().strip())
    counter = 1
    n = K
    e = 1
    while counter < K:
        print(e)
        e += 1
        if (n/S(n)) <= (n+10000/S(n+10000)):
            counter += 1
        n += 1
    print(n)


def S(n):
    return sum([int(x) for x in str(n)])


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 50, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

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

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:
import math
hahaha = int(input())
t = 10000
min = 1e16
keta = 15
nine = "999999999999999999999"
ans = []
for i in range(keta-4):
    i = keta - i
    for j in range(1,t-9):
        j = t - j
        st = str(j)
        hoge = st+nine
        target = int(hoge[0:i])
        sum = 0
        ltarget = list(str(target))
        for a in ltarget:
            sum += int(a)
        num = target / sum
        if min >= num:
            min = num
            # print(target,num)
            ans.append(target)
for i in range(1,t):
    i = t - i
    li = list(str(i))
    sum = 0
    for a in li:
        sum += int(a)
    num = i / sum
    if min >= num:
        min = num
        # print(i,num)
        ans.append(i)
ans.sort()
for i in range(hahaha):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
K = int(input())
i = 1
i_ = i
while K > 0:
    if i >= i_*10:
        i += i_*10-i_
        i_ = i_*10
    print(i)
    i += i_
    K -= 1

Submission status: Wrong Answer

Solution code:
sunu = [1,2,3,4,5,6,7,8]
for i in range(1,1000):
    for j in range(1,10):
        sunu.append(j*10**(i)-1)
#sunu.append(999999999999999)
a = int(input())
for i in range(a):
    print(sunu[i])

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 10, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

end_flg = 0
for i in range(15):
    # 桁ごとに出力
    for j in range(1, 10):
#        print({end_flg: (10 ** i - 1) + j * 10 ** i})
        print((10 ** i - 1) + j * 10 ** i)
        end_flg += 1
        if end_flg == K:
            break
    if end_flg == K:
        break

while end_flg < K:
    print((10 ** i - 1) + j * 10 ** i)
#    print({end_flg: (10 ** i - 1) + j * 10 ** i})
    end_flg += 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
    digits = 2
    while len(num_list) < K:
        num_list.append(n)
        if str(n+1)[0] == '3':
            digits += 1
        n += 10**(digits - 1)
    print(*num_list, sep='\n')

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[1,2,3,4,5,6,7,8,9]
i=1
j=1
l=0
snuke=9
num=9
while len(ans)<k:
    snuke+=10**i
    ans.append(snuke)
    if snuke//(10**i)==num:
        num+=10**j
        i+=1
        l+=1
        if l==9:
            j+=1
for i in range(k):
    print(ans[i])

Submission status: Wrong Answer

Solution code:
import math

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

K = int(input())

for n in range(1, K + 1):
    print(((n % 9) + 1) * 10 ** math.floor(n // 9) - 1)

Submission status: Wrong Answer

Solution code:
SNK = [1,2,3,4,5,6,7,8,9] #1桁目

for i in range(1,10): SNK.append((i*10)+9) #2桁目
for i in range(1,10): SNK.append((i*100)+99) #3桁目

for j in range(9): #4-12桁目
    SNK_sub = [19,29,39,49,59,69,79,89,99]
    SNK_sub = list(map(lambda x:(x*pow(10,2+j))+(pow(10,2+j)-1),SNK_sub))
    for i in range(10,20+(10*j)):
        SNK.append(i*pow(10,2+j)+(pow(10,2+j)-1))
    SNK += SNK_sub[j+1:]
    
for j in range(2): #13,14桁目
    SNK_sub = [199,299,399,499,599,699,799,899,999]
    SNK_sub = list(map(lambda x:(x*pow(10,10+j))+(pow(10,10+j)-1),SNK_sub))
    for i in range(100,200+(100*j)):
        SNK.append(i*pow(10,10+j)+(pow(10,10+j)-1))
    SNK += SNK_sub[j+1:]

K = int(input())

for i in range(K):
    print(SNK[i])

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 1
a = 0
b = 0
c = 0
cnt = 0

for i in range(10**15):
    for j in str(i+1):
        a += int(j)
    for l in str(i+2):
        b += int(l)
    for g in str(i+11):
        c += int(g)
    if (i+1) * b <= (i+2) * a and (i+1) * c <= (i+11) * a:
        print(i+1)
        cnt += 1
        a = 0
        b = 0
        c = 0
        if cnt == k:
            break
    else:
        a = 0
        b = 0
        c = 0

Submission status: Wrong Answer

Solution code:
K=int(input())
c=1
while K and c<60:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1
c=10
while K and c<50:
    print(c,'9'*5,sep='')
    K-=1
    c+=1
c=65
while K and c<60:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1

Submission status: Wrong Answer

Solution code:
K = int(input())

def sunuke(N):
    res = 0
    for n in str(N):
        res += int(n)
    return res



i, n = 0, 0
while i < K:
    n += 1
    if n / sunuke(n) <= ((n+1)/ sunuke(n+1)):
        if str(n)[-1] == "9":
            if n / sunuke(n) <= ((n+10)/ sunuke(n+10)):
                print(n)
                i += 1
        else:
            print(n)
            i += 1

Submission status: Wrong Answer

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

def get_s(n):
    s_n = 0
    for e_str in str(n):
        s_n += int(e_str)
    return s_n

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 5):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for i in range(len(str(n)) - 5, len(str(n))):
        if i < 10:
            continue
        m = str(n)[:-i]
        add_num = 1
        for _ in range(0, i):
            m += '0'
            add_num *= 10
        m = int(m)
        m += add_num - 1
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break

    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

ans_list = list(ans)
ans_list.sort()
for i in range(0, k):
    print(ans_list[i])

Submission status: Wrong Answer

Solution code:
def sumd(n):
    res=0
    while n>0:
        res+=(n%10)
        n=int(n/10)
    return res

k=int(input())

cnt=0
n=1
m=n+1
x=list()
flag=1

while cnt<k:
    while m<n+11:
        #print("n="+str(n))
        if (n/sumd(n))<=(m/sumd(m)):
            #print("  m="+str(m))
            m=m+1
            flag=1
        else:
            flag=0
            break
    #print("flag="+str(flag))
    if flag==1:
        cnt+=1
        x.append(n)
    n+=1
    m=n+1
#print("cnt="+str(cnt))
for i in x:
    print(i)

Submission status: Wrong Answer

Solution code:
K = int(input())
nums = [x for x in range(1,10)]
limit = pow(10,15)
count = 9
now = 0
while count < K:
  if now == 0:
    nums.append(19)
  else:
    if limit < 199*pow(10,now-1):
      break
    nums.append(199*pow(10,now-1))
  count += 1
  now += 1
for i in range(len(nums)):
  print(nums[i])

Submission status: Wrong Answer

Solution code:
sunukes = [1, 2, 3, 4, 5, 6, 7, 8, 9]
k = int(input())

while len(sunukes) < k:
    sunukes.append(int(str(sunukes[-9]) + '9'))

for n in sunukes[:k]:
    print(n)

Submission status: Wrong Answer

Solution code:
import math
hahaha = int(input())
t = 1000
min = 1e16
keta = 15
nine = "999999999999999999999"
ans = []
for i in range(keta-3):
    i = keta - i
    for j in range(1,t-9):
        j = t - j
        st = str(j)
        hoge = st+nine
        target = int(hoge[0:i])
        sum = 0
        ltarget = list(str(target))
        for a in ltarget:
            sum += int(a)
        num = target / sum
        if min >= num:
            min = num
            # print(target,num)
            ans.append(target)
for i in range(1,t):
    i = t - i
    li = list(str(i))
    sum = 0
    for a in li:
        sum += int(a)
    num = i / sum
    if min >= num:
        min = num
        # print(i,num)
        ans.append(i)
ans.sort()
for i in range(hahaha):
    print(ans[i])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def main():
    K = int(input().strip())
    counter = 1
    n = K
    e = 1
    while counter < K:
        print(e)
        e += 1
        if (n/S(n)) <= (n+31/S(n+31)):
            counter += 1
        n += 1
    print(n)


def S(n):
    return sum([int(x) for x in str(n)])


if __name__ == '__main__':
    main()

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)
    elif i < 20:
        k = 10 ** (i//10)
        x = k * (i % 10) + k - 1
        print(x)
    else:
        j = (i - 20) % 90
        m = (i - 20) // 90
        k = 10 ** (m + 1)
        l = 10 ** (m + 2)
        x = l + k * (j + 1) - 1
        print(x)