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:
for i in range(int(input())):
    if 0<=i<9:
        print(i+1)
    else:
        print((i-7)*10-1)

Submission status: Wrong Answer

Solution code:
K=input()

for i in range(1,10):
	print i
	K-=1
	if K==0:
		quit()

for keta in range(2,16):

	for i in range(1,10):
		print (10**(keta-1))*i+10**(keta-1)-1
		K-=1
		if K==0:
			quit()

Submission status: Wrong Answer

Solution code:
K=input()
print K


for i in range(1,10):
	print i
	K-=1
	if K==0:
		quit()

for keta in range(2,16):

	for i in range(1,10):
		print (10**(keta-1))*i+10**(keta-1)-1
		K-=1
		if K==0:
			quit()

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1, K + 1):
  n = []
  x = i
  while x > 0:
    n.append(str(min(x, 9)))
    x -= 9
  n.reverse()
  print(''.join(n))

Submission status: Wrong Answer

Solution code:
N=int(input())
p=0
a=0
n=0
for i in range(N):
    a+=10**n
    p+=1
    print(a)
    if p==9:
        n+=1
        p=0

Submission status: Wrong Answer

Solution code:
def S(n):
    ans = 0
    while n > 0 :
        ans += n % 10
        n //= 10
    return ans
K = int(input())

now = 1
t = 0
for _ in range(K):
    print(str(now) + ("9" * t))
    now += 1
    if now == 10 :
        now = 1
        t += 1

Submission status: Wrong Answer

Solution code:
# coding : utf-8

K = int(input())

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

# 10以上は、最上位の位を除いた下の位全てが9の場合すぬけ数となる
if K <= len(Sunuke):
    for i in range(K):
        print(Sunuke[i])

else:
    # 見つけなければいけない残りのすぬけ数
    resi = K - len(Sunuke)
    # 最上位の桁数(0の場合1の位、1の場合10の位)
    digit = 1

    while resi > 0:
        # 最上位の位の数
        for i in range(1, 10):
            num = i * (10**digit) - 1
            Sunuke.append(num)

            resi -= 1
            # if resi == 0:
            #     break

        digit += 1


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

Submission status: Wrong Answer

Solution code:
MAX = 10**15+1

def find_next_n(n):
    cand = []
    n_str = str(n)
    n_list = list(n_str)
    for i in range(1,len(str(n))+1):
        n_list[-i] = '9'
        cand.append(int("".join(n_list)))
    cand_result = [num/snuke(num) for num in cand]
    min_idx = cand_result.index(min(cand_result))

    return cand[min_idx]
    
    
def snuke(num):
    ans = 0
    while num//10 != 0:
        ans += num%10
        num = num//10
    return ans + num

def main():
    K = int(input())
    if K<10:
        for i in range(1,K+1):
            print(i)
    else:
        n = 10
        for i in range(1,K+1):
            print(i)
        for i in range(10,K+1):
            ans = find_next_n(n)
            print(ans)
            n = ans+i
            
            if n>MAX:
                break
    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
MAX = 10**15+1

def find_next_n(n):
    cand = []
    n_str = str(n)
    n_list = list(n_str)
    for i in range(1,len(str(n))+1):
        n_list[-i] = '9'
        cand.append(int("".join(n_list)))
    cand_result = [num/snuke(num) for num in cand]
    min_idx = cand_result.index(min(cand_result))

    return cand[min_idx]
    
    
def snuke(num):
    ans = 0
    while num//10 != 0:
        ans += num%10
        num = num//10
    return ans + num

def main():
    K = int(input())
    if K<10:
        for i in range(1,K+1):
            print(i)
    else:
        n = 10
        for i in range(K):
            print(i)
        for i in range(10,K+1):
            ans = find_next_n(n)
            print(ans)
            n = ans+i
            
            if n>MAX:
                break
    
    
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
def s(n):
    ret=0    
    for i in range(15):
        ret+=(n%10**(i+1))//10**i
    return ret

k=int(input())
ans=set()
m=float('inf')
for i in reversed(range(14)):
    for j in reversed(range(1,1000)):
        n=int(str(j)+'9'*i)
        if n/s(n)<=m :
            ans.add(n)
            m=n/s(n)
ans=sorted(list(ans))
for a in ans[:k]:
    print(a)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())
count = 0
ans = []
minN = 10**15

for i in reversed(range(12)):
    minN = 10**15
    for j in reversed(range(1,10**3)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(int(num))

for i in list(sorted(list(set(ans))))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())
count = 0
ans = []
minN = 10**15

for i in reversed(range(5)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i*3
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)

for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())
k = 100
count = 0
ans = []
minN = 10**15

for i in reversed(range(5)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i*3
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)

for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())
k = 100
count = 0
ans = []
minN = 10**15

for i in reversed(range(5)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i*3
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(num == "379999"):
            print("tes")
        if(minN > n or n==1):
            minN = n
            ans.append(num)

print(len(ans[0]),len(ans))

for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(11)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)
            
#print(len(ans))
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(12)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)
            
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(12)):
    for j in reversed(range(1,10**4)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)
            
            
print(len(ans[0]))
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(14)):
    for j in reversed(range(1,100)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)
            
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(13)):
    for j in reversed(range(1,1000)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n or n==1):
            minN = n
            ans.append(num)
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(15)):
    for j in reversed(range(1,100)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN > n):
            minN = n
            ans.append(num)
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(15)):
    for j in reversed(range(1,1000)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN >= n):
            minN = n
            ans.append(num)
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(15)):
    for j in reversed(range(1,100)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN >= n):
            minN = n
            ans.append(num)
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())

count = 0
ans = []
minN = 10**15

for i in reversed(range(13)):
    for j in reversed(range(1,100)):
        num = str(j)+"9"*i
        n = sum([int(k) for k in num])
        n = int(num)/n
        if(minN >= n):
            minN = n
            ans.append(num)
            
for i in list(reversed(ans))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
# ===================================
# (c) MidAndFeed aka ASilentVoice
# ===================================
# import math 
# import collections
# import string
# ===================================
n = int(input())
s = [9]
for i in range(1, n+1):
	if i < 10:
		print(i)
	else:
		if s[0] == 9:
			s = [1] + s
		else:
			s[0] = s[0] + 1
		print("".join(map(str, s)))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
k = int(input())
ans = 10**15
li = []
for i in reversed(list(range(1,10**3))):
    snk = sum([int(j) for j in str(i)])
    if(ans >= i/snk):
        ans = i/snk
        li.append(i)
        
for i in list(reversed(li))[:k]:
    print(i)

Submission status: Wrong Answer

Solution code:
K = int(input())
import numpy as np
def sumn(num):
    return num // sum(list(map(int, str(num))))

a,b = [],[]
for i in range(16):
    for j in range(1,10):
        a.append(int(str(j)+"9"*i))
for i in range(1,16):
    for j in range(10,1001):
        a.append(int(str(j)+"9"*i))
a = np.sort(np.unique(np.array(a)))
v = np.vectorize(sumn)
b = v(a)


n = 0
while True:
    for i in range(len(b)):
        if np.min(b[i:]) >= b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
K = int(input())
import numpy as np
def sumn(num):
    return num // sum(list(map(int, str(num))))

a,b = [],[]
for i in range(16):
    for j in range(1,1001):
        a.append(int(str(j)+"9"*i))
a = np.sort(np.unique(np.array(a)))
v = np.vectorize(sumn)
b = v(a)


n = 0
while True:
    for i in range(len(b)-1):
        if np.min(b[i+1:]) > b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
K = int(input())
import numpy as np
def sumn(num):
    return num // sum(list(map(int, str(num))))

a,b = [],[]
for i in range(16):
    for j in range(1,1001):
        a.append(int(str(j)+"9"*i))
a = np.sort(np.unique(np.array(a)))
v = np.vectorize(sumn)
b = v(a)


n = 0
while True:
    for i in range(len(b)):
        if np.min(b[i:]) >= b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99] #18
k = int(input())
for i in range(k):
    j,l = divmod(i,18)
    print((a[l]+1)*(100**j)-1)

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import math 
# 整数の入力
k = int(input())

for n in range(1,k+1):
    if (n % 9) == 0:
        print ("9" * math.floor(n/9))
    else:
        print(str((n % 9)) + "9" * math.floor(n/9))

Submission status: Wrong Answer

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

K=int(input())

c=0
for i in range(1,(10**15)+1):
	if(c==K):
		break
	if i<10:
		print(i)
		c+=1
	elif i%10==9:
		if (i/S(i)) <= ((i+10)/S(i+10)):
			print(i)
			c+=1

Submission status: Wrong Answer

Solution code:
k = int(input())
n=0
a=1
b=0
if a==1 and n<9:
    while n<9 and b<k:
        n+=1
        print(n)
        b+=1
    a+=1
if a==2:
    while n<90 and b<k:
        n+=10
        print(n)
        b+=1
    a+=1
while b<k:
    n+=10**(a-1)
    print(n)
    b+=1
    if n>((a-1)*10**a-10**(a-1)):
        a+=1

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 23 22:26:22 2018

@author: maezawa
"""

k = int(input())

i = 1
s = []
j = 1
while i < k+1:
    if i<10:
        s.append(str(i))
        print(i)
        i += 1
        j = (j+1)%10
    else:
        s[j] = s[j] + '9'
        print(s[j])
        i += 1
        j = (j+1)%9

Submission status: Wrong Answer

Solution code:
k = int(input())

ans = 0
count = 0
for i in range(k//9+1):

    for j in range(9):
        if(i>=3 and j==0):
            for k in range(9):
                ans+=10**(i-1)
                print(ans)
                count+=1

            ans-=10**(i-1)*9
        ans+=10**i
        
        print(ans)
        count+=1
        if(count==k):
            break

Submission status: Wrong Answer

Solution code:
K = int(input())

a,b = [],[]
for i in range(16):
    for j in range(1,11):
        a.append(int(str(j)+"9"*i))
        b.append(a[-1] // sum(list(map(int, str(a[-1])))))


n = 0
while True:
    for i in range(len(b)):
        if min(b[i:]) >= b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
"""
Created on Sat Jun 23 22:26:22 2018

@author: maezawa
"""

k = int(input())

i = 1
s = []
j = 1
while i < k+1:
    if i<10:
        s.append(str(i))
        print(i)
        i += 1
        j = (j+1)%9
    else:
        s[j] = s[j] + '9'
        print(s[j])
        i += 1
        j = (j+1)%9

Submission status: Wrong Answer

Solution code:
K = int(input())

a,b = [],[]
for i in range(16):
    for j in range(1,11):
        a.append(int(str(j)+"9"*i))
        b.append(a[-1] / sum(list(map(int, str(a[-1])))))


n = 0
while True:
    for i in range(len(b)):
        if min(b[i:]) >= b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
K = int(input())

a,b = [],[]
for i in range(16):
    for j in range(1,101):
        a.append(int(str(j)+"9"*i))
        b.append(a[-1] / sum(list(map(int, str(a[-1])))))

n = 0
while True:
    for i in range(len(b)):
        if min(b[i:]) >= b[i]:
            print(a[i])
            n += 1
            if n == K: exit()

Submission status: Wrong Answer

Solution code:
k = int(input())
n=0
a=1
b=0
if a==1 and n<9:
    while n<9 and b<k:
        n+=1
        print(n)
        b+=1
    a+=1
if a==2:
    while n<90 and b<k:
        n+=10
        print(n)
        b+=1
    a+=1
while b<k:
    n+=10**(a-1)
    print(n)
    b+=1
    if n>(2*10**a-10**(a-1)):
        a+=1

Submission status: Wrong Answer

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

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(K):
	print(Sn[i])

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np
from operator import itemgetter

k =int(input())
nmax=0
s = []
for i in range(1,200):
    for j in range(14):
        p = i
        for ii in range(j):
            p=p*10+9
        q = i // 100 + (i // 10) % 10 + i % 10 + 9*j
        r = p / q

        s.append((p,q,r))

s= sorted( s, key=itemgetter(2) )
print(s)
num=0
for a in s :
    if a[0] > nmax:
        nmax = a[0]
        print(nmax)
        num += 1
        if num >= k :
            break

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
temp = 99
count = 2
while i < n:
    if i <9:
        print(i+1)
    elif i < 18:
        print(9+10*(i-8))
    elif count >2:
        for j in range(90):
            i+=1
            if i>=n:
                break
            temp+=(10**count)
            print(temp)
        count+=1
    else:
        for j in range(99):
            i+=1
            if i>=n:
                break
            temp+=(10**count)
            print(temp)
        count+=1

    i+=1

Submission status: Wrong Answer

Solution code:
K=int(input())

c=0
for i in range(1,(10**15)+1):
	if(c==K):
		break
	if i<10:
		print(i)
		c+=1
	elif i%10==9:
		print(i)
		c+=1

Submission status: Wrong Answer

Solution code:
n = int(input())
i = 0
temp = 99
count = 2
while i < n:
    if i <9:
        print(i+1)
    elif i < 18:
        print(9+10*(i-8))
    if count >2:
        for j in range(90):
            i+=1
            if i>=n:
                break
            temp+=(10**count)
            print(temp)
        count+=1
    else:
        for j in range(99):
            i+=1
            if i>=n:
                break
            temp+=(10**count)
            print(temp)
        count+=1

    i+=1

Submission status: Wrong Answer

Solution code:
k = int(input())

ans = 0
count = 0
for i in range(k//9+1):
    for j in range(9):
        ans+=10**i
        print(ans)
        
        count+=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(1,keta+1):
    make(i)

make_(keta, res)

Submission status: Wrong Answer

Solution code:
K=int(input())

c=0
for i in range(1,10**15):
	if(c==K):
		break
	if i<10:
		print(i)
		c+=1
	elif i%10==9:
		print(i)
		c+=1

Submission status: Wrong Answer

Solution code:
K = int(input())
# count = 0
# for i in range(100000000000000):
#     if(count == K):
#         break
#     num = 0
#     try:
#         tmp = str(i)
#         for j in tmp:
#             num += int(j)
#         # print("n:{},  s:{}, ans ={}".format(i,num,int(i) / num))
#         if(i < 10 or tmp[1:] == "9" * (len(tmp)-1)):
#             if(i != 0):
#                 print(i)
#                 # print("n:{},  s:{}, ans ={}".format(i, num, int(i) / num))
#                 count += 1
#     except:
#         continue
# # ans = [i for i in range(10)]
count = 0
flag = False
for i in range(9):
    if(count == K):
        flag = True
        break
    print(i+1)
    count += 1
nins = 9
bi = 10
if(flag == False):
    while True:
        for i in range(9):
            if(count == K):
                flag = True
                break
            print(nins + (i+1) * bi)
            count += 1
        if(flag == True):
            break
        # print(count)
        nins = str(nins) + "9"
        nins = int(nins)
        bi = str(bi) + "0"
        bi = int(bi)

Submission status: Wrong Answer

Solution code:
K=int(input())

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

Submission status: Wrong Answer

Solution code:
K=int(input())

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

Submission status: Wrong Answer

Solution code:
import bisect

K = int(input())
num = 1
limit = 10000
insert_index = 0
count = 0

sunuke_div = []
sunuke_num = []

while count < K:
    num_ = str(num)
    Sn = 0
    for n in num_:
        Sn += int(n)
    sunuke = num/Sn
    pre_insert_index = insert_index
    insert_index = bisect.bisect_right(sunuke_div, sunuke)
    sunuke_div.insert(insert_index, sunuke)
    sunuke_num.insert(insert_index, num)
    if pre_insert_index < insert_index:
        print(num-1)
        count += 1
    num += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
# count = 0
# for i in range(100000000000000):
#     if(count == K):
#         break
#     num = 0
#     try:
#         tmp = str(i)
#         for j in tmp:
#             num += int(j)
#         # print("n:{},  s:{}, ans ={}".format(i,num,int(i) / num))
#         if(i < 10 or tmp[1:] == "9" * (len(tmp)-1)):
#             if(i != 0):
#                 print(i)
#                 # print("n:{},  s:{}, ans ={}".format(i, num, int(i) / num))
#                 count += 1
#     except:
#         continue
# # ans = [i for i in range(10)]
count = 0
flag = False
for i in range(9):
    if(count == K):
        flag = True
        break
    print(i+1)
    count += 1
nins = 9
bi = 10
if(flag == False):
    while True:
        for i in range(10):
            if(count == K):
                flag = True
                break
            print(nins + (i+1) * bi)
            count += 1
        if(flag == True):
            break
        # print(count)
        nins = str(nins) + "9"
        nins = int(nins)
        bi = str(bi) + "0"
        bi = int(bi)

Submission status: Wrong Answer

Solution code:
K = int(input())
a = []

for i in range(1, 10*15):
    temp = str()
    while i > 0:
        if i > 8:
            temp = temp + '9'
            i += -9
        else:
            temp = temp + str(i)
            i = 0
    ans = temp[::-1]
    a.append(int(ans))

ans = []

for i in range(len(a)):
    for j in range(i + 1, len(a)):
        if a[i] / (i+1) > a[j] / (j+1):
            break
    else:
        ans.append(a[i])
    if len(ans) == K:
        break

for i in ans:
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())
sunuke = []
for digit in range(k//9+1):
    sunuke.extend([int(str(i)+'9'*digit) for i in range(1, 10)])

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

Submission status: Wrong Answer

Solution code:
a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
b = set()
k = int(input())
for i in a:
    for s in range(0,k):
        t = str(i)+str(9)*s
        b.add(int(t))
for i in range(k):
    print(sorted(b)[i])

Submission status: Wrong Answer

Solution code:
# https://beta.atcoder.jp/contests/abc101/tasks/arc099_b
# D - Snuke Numbers

# D_Snuke_Numbers.py

K = int(input())
#K = 10

c = 0
keta = 0
keta_now = 1
for i in range(10 **15 +1):
    i += 1
    if keta_now * 10 == i:
        keta += 1
    if (i+1) % keta_now == 0:
        print(i)
        c += 1
        if c == K:
            break

Submission status: Wrong Answer

Solution code:
import math
KK = int(input())
K=10000
x=[]
for i in range(1,K):
    s = sum([int(j) for j in str(i)])
    x.append([i,i/s])
x.sort(key=lambda x: x[1])
for i in range(KK):
  print(x[i][0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
res = [str((i%10)) + '9'*math.floor(i/10) for i in range(2*K) if i % 10 != 0]
for i in range(K):
    print(res[i])

Submission status: Wrong Answer

Solution code:
K = int(input())
a = []

for i in range(1, K+1):
    temp = str()
    while i > 0:
        if i > 8:
            temp = temp + '9'
            i += -9
        else:
            temp = temp + str(i)
            i = 0
    ans = temp[::-1]
    a.append(int(ans))

for i in a:
    print(i)

Submission status: Wrong Answer

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

K = int(input())
i = 0
g = 0
while True:
    i += 1
    if g == K:
        break
    if i <= 9:
        print(i)
        g += 1
        # pass
    else:
        l1 = i% 10
        keta = i // 10
        if l1 != 0 :
            i9 = int('9' * keta)
            print(int(str(l1)+str(i9)))
            g += 1

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)])

prev = None

for x in sorted([(sunuke(i), i) for i in range(1, pow(10, keta + 3))])[:k]:
    if prev == x[0]:
        pass
    else:
        print(x[1])
        prev = x[0]

Submission status: Wrong Answer

Solution code:
import math
k = int(input())
def num(x):
    nu = 0
    for i in range(len(x)):
        nu += int(x[i])
    return(int(x) / nu)
if k <= 9:
    for i in range(1,k+1):
          #print(i,num(str(i)))
        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))
              #print(str(m)+"9"*(i),num(str(m)+"9"*(i)))
    else:
        for m in range(1,co+1):
            print(str(m) + "9" * (i))
              #print(str(m)+"9"*(i),num(str(m)+"9"*(i)))

Submission status: Wrong Answer

Solution code:
K = int(input())
count = 0
for i in range(K):
	if i<9:
		count = count + 1
		print(i+1)
	else:
		n = int(i/9)
		r = (i%9)+1
		if r <= n-2:
			for k in range(10):
				out = (r+1)*(10**n)-1-(9-k)*(10**(n-1))
				print(out)
				count = count + 1
				if count == K:
					break
			if count == K:
				break
		else:
			out = (r+1)*(10**n)-1
			print(out)
			count = count + 1
	if count == K:
		break

Submission status: Wrong Answer

Solution code:
a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
b = set()
k = int(input())
for i in a:
    for s in range(0,k):
        t = str(i)+str(9)*s
        b.add(int(t))
s = sorted(b)
for i in s:
    print(i)

Submission status: Wrong Answer

Solution code:
K = 10

M = 10 **15 +1
c = 0
keta = 0
for i in range(M):
    i += 1
    if 10 ** (keta + 1) == i:
        keta += 1
    if (i+1) % (10**keta) == 0:
        print(i)
        c += 1
        if c == K:
            break

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1, k + 1):
    ans = '9' * (i // 9)
    if i % 9 != 0:
        ans = str(i % 9) + ans

    print(ans)

Submission status: Wrong Answer

Solution code:
k = int(input())
cnt = 0
def func(num):
    return num/sum(list(map(int,list(str(num)))))
num = 1
while cnt < k:
    now = func(num)
    tmp = func(num + 1)
    if now <= tmp:
        cnt += 1
        print(num)
    num += 1

Submission status: Wrong Answer

Solution code:
def get_sum(n):
    str_n = str(n)
    ans = 0
    for d in str_n:
        d = int(d)
        ans += d
    return ans


def get_until(n):
    str_n = str(n)
    keta = len(str_n) - 2
    if keta < 0:
        return 0
    return 10 ** keta


def solve():
    k = int(input())
    n = 1
    while k != 0:
        nsum = get_sum(n)
        next_n = n + get_until(n)
        next_nsum = get_sum(next_n)
        if (n / nsum) <= (next_n / next_nsum):
            print(n)
            k -= 1
        n += 1

if __name__ == '__main__':
  solve()

Submission status: Wrong Answer

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

k = input()
count = 0
for nn in range(1000000000000000):
    num = nn+1
    if count == int(k):
        break
    if num < 10:
        print(num)
        count += 1
    elif not str(num)[-1] == '9':
        continue
    else:
        tmp_num = int(num) + 10
        if num/func(num) <= tmp_num/func(tmp_num):
            print(num)
            count += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
tot = 1
nines = ''
while K >= tot:
    if tot < 10:
        print(tot)
        if K < tot:
            break
        tot += 1
        continue
    nines += '9'

    for i in range(1, 10):
        if K < tot:
            break
        print(str(i) + nines)
        tot += 1

Submission status: Wrong Answer

Solution code:
from bisect import insort_right
from sys import stdin, stdout
input = lambda: stdin.readline().rstrip()
write = stdout.write

def main():
    K = int(input())

    num = []
    for i in range(1, 100000):
        n = i / sum(map(int, list(str(i))))
        insort_right(num, (n, i))

    for i in num[:K]:
        write(str(i[1]) + '\n')

main()

Submission status: Wrong Answer

Solution code:
k = int(input())
if k <= 9:
    for i in range(1, k+1):
        print(i)
else:
    sunuke = [x for x in range(1, 10)]

    sunuke.extend([int('1'+'9'*i) for i in range(1, k)])

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

Submission status: Wrong Answer

Solution code:
#coding:utf-8
K = int(input())
ten = K // 9
sur = K % 9
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())
#
# for i in ragen(1, K + 1):
#     if i < 10:
#         print(i)
#     elif i <



for i in range(1, K + 1):
    moji = ''
    margin = i % 9
    sho = i // 9
    if i > 27:
        j = i - 28 + 10
        jsho = j // 99
        jamari = (i - 28 + 10) % 99
        if jamari == 0:
            moji += '9'
            for j in range(jsho):
                moji += '9'
        else:
            moji += str((i - 28 + 10) % 99)
            for k in range(jsho):
                moji += '9'
        moji += str(99)

    elif margin == 0:
        for j in range(sho):
            moji += '9'
    else:
        moji += str(i % 9)
        for j in range(sho):
            moji += '9'
    print(int(moji))

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-10**14*8:
        break
    if str(n)[0:1]=="9":
        zouka=zouka*10
    print(n)
    
    count+=1