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:
import math
n=int(input())
base=list(map(str,[1,2,3,4,5,6,7,8,9]))
arr=[j for j in range(10,100)][::-1]
#print(arr)
count=0
for i in range(math.ceil(n/9)):
    tmp=[]
    if count<27:
        for k in base:
            print(k)
            count+=1
            if count==n:
                break
            tmp.append(k+"9")
        base=tmp

plusnum="99"
#print(count)
while count<n:
    initnum=99999999999999999999
    tmp=[]
    for j in arr:
        number=str(j)+plusnum
        sumnumber=0
        for nn in number:
            sumnumber+=int(nn)
        smallnum=int(str(j)+plusnum)/sumnumber
        if smallnum<initnum:
            tmp.append(number)
            initnum=smallnum
    if n<len(tmp)+count:
        for i in range(n-count):
            print(tmp[::-1][i])
    else:
        for i in tmp[::-1]:
            print(i)
    plusnum+="9"
    count+=len(tmp)
"""
    else:
        plus=(count//9)-1
        plusnum=""
        for num in range(plus):
            plusnum+="9"

        initnum=99999999999999999999
        for j in arr:
            number=str(j)+plusnum
            sumnumber=0
            for nn in number:
                sumnumber+=int(nn)
            smallnum=int(str(j)+plusnum)/sumnumber
            if smallnum<initnum:
                tmp.append(number)
                initnum=smallnum
                print(tmp)
        #print(base)
"""

Submission status: Wrong Answer

Solution code:
K = int(input())
sunuke_num = [0] * 250000
for num in range(1, 250001):
    sunuke_num[num-1] = num / sum([int(i) for i in list(str(num))])

for i in range(len(sunuke_num)-10000):
    flg = 1
    for j in range(i + 1, i+100):
        if sunuke_num[i] > sunuke_num[j]:
            flg = 0
            break
    if flg:
        K -= 1
        print(i+1)
        if K == 0:
            break

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 if len(nines) < 3 else 0, 10):
        if K < tot:
            break
        print(str(i) + nines)
        # func(int(str(i) + nines))
        tot += 1

Submission status: Wrong Answer

Solution code:
"""
for i in range(9999999999999, 111000000000000, 1000000000000):
    print( "{} / {} = {}".format(i, sum(map(int, list(str(i)))), i/sum(map(int, list(str(i)))) ))
"""

# 桁数を返す
def intlen(n):
    return len(str(n))

# 10の累乗か否かを返す
def ispow10(n):
    while n>1:
        n /= 10
    if n==1:
        return True
    return False

# num: 出力する数の始点
num = 1
K = int(input())
for i in range(K):
    print(num)
    if intlen(num) <= 3:
        if ispow10(num+1):
            if num!=999:
                num += 10**intlen(num)
            else:
                num += 100
        else:
            num += 10**(intlen(num)-1)
    elif intlen(num) <= 12:
        if num//(10**(intlen(num)-2)) <= (intlen(num)-3)*10 + 8:
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)
    else:
        if ispow10(num+1):
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)

Submission status: Wrong Answer

Solution code:
K = int(input())

a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
v = 99
i = 18
if K > 18:
    while i < K:
        v += 100
        a.append(v)
        i += 1
    for i in a:
        print(i)
else:
    for i in a:
        print(i)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

#for i in range(1,55):
#  s = 0
#  for j in range(len(str(i))):
#    s += int(str(i)[j])
#  print(str(i)+": "+str(i/s))
counter = 0

if K<10:
  for i in range(1,K+1):
    print(i)
else:
  for i in range(1,10):
    counter += 1
    print(i)
  i = 9
  while(counter!=K):
    i += 10
    print(i)
    counter += 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, 1000000) + 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:
K=int(input())

count=0
n=0
zouka=1

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

Submission status: Wrong Answer

Solution code:
"""
for i in range(9999999999999, 111000000000000, 1000000000000):
    print( "{} / {} = {}".format(i, sum(map(int, list(str(i)))), i/sum(map(int, list(str(i)))) ))
"""

# 桁数を返す
def intlen(n):
    return len(str(n))

# 10の累乗か否かを返す
def ispow10(n):
    while n>1:
        n /= 10
    if n==1:
        return True
    return False

# num: 出力する数の始点
num = 1
K = int(input())
for i in range(K):
    print(num)
    if intlen(num) <= 3:
        if ispow10(num+1):
            if num!=999:
                num += 10**intlen(num)
            else:
                num += 100
        else:
            num += 10**(intlen(num)-1)
    elif intlen(num) <= 12:
        if num//(10**(intlen(num)-2)) <= (intlen(num)-3)*10 + 8:
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)
    else:
        if ispow10(num):
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)

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
        jamari = j // 99
        moji += str((i - 28 + 10) % 99)
        for k in range(jamari):
            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:
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 + 10):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for m in range(n + 1+10, n + 1 + 10+50*3, 3):
        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:
n = int(input())
count = 0
for i in range(n):
    if i < 9:
        print(i+1)
    elif i <18:
        print(10*(i-7)-1)
        end = 99
    else:
        if i <150:
            temp = (i-17)//100
            if  (i-17)%100 == 0:
                temp-=1
                count+=1
        else:
            temp = (i - (17+90*count)) // 100
            if (i - (17+90*count)) % 100 == 0:
                temp -= 1
                count+=1
        end += 10**(temp+2)
        if (i-17)%100==0:
            end += 9*(10**(temp+2))
        elif i>150 and (i-7)%100 == 0:
            end += 9 * (10 ** (temp + 2))
        """
        if (i-17)%100 == 0:
            end -= 9*(10**(temp+3))
            end += 10**(temp+4)
        """
        print(end)

Submission status: Wrong Answer

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

ct=0
for i in range(1,10):
    print(i)
    ct+=1
    if ct==K:
        break
nines=1
while ct<K:
    ketact=9+10*(nines-1)
    start=nines-1
    for i in range(start,ketact+1):
        print(str(i).replace("0","")+"9"*nines)
        ct+=1
        if ct==K:
            break
    nines+=1

Submission status: Wrong Answer

Solution code:
K = int(input())

count = 0
i = 0
start_p = 1
#2分探索
while True:
    i += 1
    sunuke_m = list(map(int, list(str(start_p+1))))
    sunuke_n = list(map(int, list(str(start_p))))
    sunuke_m = (start_p+1)/sum(sunuke_m)
    sunuke_n = (start_p)/sum(sunuke_n)

    if sunuke_m >= sunuke_n:
        count += 1
        print(start_p)
        if count == K:
            break

    start_p += 1

Submission status: Wrong Answer

Solution code:
K = int(input())


def f(n):
    s = 0
    for n_i in str(n):
        s += int(n_i)
    x = int(n) / s
    return x


i = 1
n = 0
cnt = 1
while cnt <= K:
    x = str(i) + '9' * n
    print(x)
    # print(x, f(x))
    i += 1
    if i > 9:
        y = str(i) + '9' * n
        z = str(i + 1) + '9' * n
        if f(y) > f(z):
            i = 1
            n += 1
    cnt += 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 and a<=99:
		return True
	else:
		return False

cnt=0
i=0
while True:
	i+=1
	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:
K = int(raw_input())
nb = 2
for i in xrange(K):
  ans = 0
  k = i + 1
  while k / 9 != 0:
    ans += 9
    ans *= 10
    k -= 9
  ans += k
  n = int(str(ans)[::-1])
  if nb < n:
  	n = nb
  nb = int(str((ans / 10 - 1) * 100 + k + 1)[::-1]) if ans > 9 else ans + 9
  print n

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 + 10):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for m in range(n + 1+10, n + 1 + 10+50*2, 2):
        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())

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:
k = int(input())
if k < 10:
    for i in range(1, k + 1):
        print(i)
else:
    for i in range(1, 10):
        print(i)
    ge = "1"
    do = "9"
    ga = "10"
    for i in range(k - 9):
        if (i + 1) % 3 == 1:
            ge += "9"
            print(ge)
        elif (i + 1) % 3 == 2:
            do += "0"
            print(do)
        if (i + 1) % 3 == 0:
            ga += "9"
            print(ga)

Submission status: Wrong Answer

Solution code:
def digitsum(n):
	
	count = 0 
	while n > 0:
		count += n%10
		n = int(n/10)
		
	return count
	
def loop(n, k):
	
	while k < 1000:
		k_d = digitsum(k)
		k_d_d = digitsum(k_d)
		
		if k/k_d <= k_d/k_d_d:
			print(k)
		k += 1
		

k = 1
n = int(input())
loop(n, k)

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

Submission status: Wrong Answer

Solution code:
k = int(input())

res = []

count = 0
for i in range(1, 10):
    print(i)
for i in range(1, k+1-9):
    i_str = str(i)
    print(int(i_str+'9'))

Submission status: Wrong Answer

Solution code:
K=input()


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

cnt=0
i=0
while True:
	i+=1
	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:
# coding: utf-8


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

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


k = int(input())

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

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 solve():
    k = int(input())
    n = 1
    while k != 0:
        nsum = get_sum(n)
        until_num = n + int((n / 10))
        next_nsum = get_sum(until_num)
        if (n / nsum) <= (until_num / next_nsum):
            print(n)
            k -= 1
        n += 1

if __name__ == '__main__':
    solve()

Submission status: Wrong Answer

Solution code:
K = int(input())
count = 0
for i in range(1000000000000000000000000000000000000000000000000000000000000):
    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 != 0 and i < 10 or tmp[1:] == "9" * (len(tmp)-1)):
            print(i)
            # print("n:{},  s:{}, ans ={}".format(i, num, int(i) / num))
            count += 1
    except:
        continue

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, 100) + 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:
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)
    end_flg += 1

while end_flg < K:
    print("")
    end_flg += 1

Submission status: Wrong Answer

Solution code:
"""
for i in range(9999999999999, 111000000000000, 1000000000000):
    print( "{} / {} = {}".format(i, sum(map(int, list(str(i)))), i/sum(map(int, list(str(i)))) ))
"""

# 桁数を返す
def intlen(n):
    return len(str(n))

# 10の累乗か否かを返す
def ispow10(n):
    while n>1:
        n /= 10
    if n==1:
        return True
    return False

# num: 出力する数の始点
num = 1
K = int(input())
for i in range(K):
    print(num)
    if intlen(num) <= 3:
        if ispow10(num+1):
            if num!=999:
                num += 10**intlen(num)
            else:
                num += 100
        else:
            num += 10**(intlen(num)-1)
    elif intlen(num) <= 12:
        if num//(10**(intlen(num)-2)) <= (intlen(num)-3)*10 + 8:
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)
    else:
        num += 10**(intlen(num)-2)

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 = int(round(K/9,0))
res = K % 9

for i in range(1,keta+1):
    make(i)

make_(keta, res)

Submission status: Wrong Answer

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

plusnum="99"
#print(count)
while count<n:
    initnum=99999999999999999999
    for j in arr:
        number=str(j)+plusnum
        sumnumber=0
        for nn in number:
            sumnumber+=int(nn)
        smallnum=int(str(j)+plusnum)/sumnumber
        if smallnum<initnum:
            tmp.append(number)
            initnum=smallnum
    if n<len(tmp)+count:
        for i in range(n-count):
            print(tmp[::-1][i])
    else:
        for i in tmp[::-1]:
            print(i)
    plusnum+="9"
    count+=len(tmp)
"""
    else:
        plus=(count//9)-1
        plusnum=""
        for num in range(plus):
            plusnum+="9"

        initnum=99999999999999999999
        for j in arr:
            number=str(j)+plusnum
            sumnumber=0
            for nn in number:
                sumnumber+=int(nn)
            smallnum=int(str(j)+plusnum)/sumnumber
            if smallnum<initnum:
                tmp.append(number)
                initnum=smallnum
                print(tmp)
        #print(base)
"""

Submission status: Wrong Answer

Solution code:
K = int(input())
i = 1
sunuke = 0
while i <= K:
    dig = (i-1)//9
    sunuke += 10**dig
    print(sunuke)
    i += 1

Submission status: Wrong Answer

Solution code:
import sys
K = int(raw_input())
c = 0
l = 0
for i in range(0, 20):
  for j in range(1, min(max(10, i*10),99)):
    k = ((10**i)*j)-1
    if k <= l:
      continue
    l = k
    print k
    c += 1
    if c >= K:
      sys.exit(0)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K=input()


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

cnt=0
i=0
while True:
	i+=1
	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:
# -*- 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): 
        if i >= 1000000000000000:
            exit()
        print(i)
        out += 1
        if out == K:
            exit()
    i += 1

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, 11):
        print(j*10**i-1)
if(loop != 0):
    for j in range(2, mod+2):
        print(j*10**(loop)-1)

Submission status: Wrong Answer

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

def sums(n):
    hoge = str(n)
    SUM = 0
    for i in hoge:
        SUM = SUM + int(i)
    return SUM

def lencheck(n):
    hoge = str(n)
    return(len(hoge))


tmp = 1
l = 1
p = 1
print(1)
for i in range(1,K+1):
    if l < lencheck(tmp):
        l = lencheck(tmp)
        tmp = tmp - p
        p = 10**(l-1)
    tmp = tmp + p
    
    print(tmp)

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 + 10):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    for m in range(n + 1+10, n + 1 + 10+30, 3):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
            
    for m in range(n + 1+10+30, n + 1 + 10+30+40, 4):
        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:
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:
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
    if i >= 9999999999999999: num = 10000000000000000
    if i > pow(10, 15): break
    print(i)
    h -= 1

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):
  if ((10**loop)*j-1) < 10**15:
  	print((10**loop)*j-1)
  # print((10**15)*j-1)
  K -= 1
  j += 1

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

Submission status: Wrong Answer

Solution code:
"""
for i in range(9999999999999, 111000000000000, 1000000000000):
    print( "{} / {} = {}".format(i, sum(map(int, list(str(i)))), i/sum(map(int, list(str(i)))) ))
"""

# 桁数を返す
def intlen(n):
    return len(str(n))

# 10の累乗か否かを返す
def ispow10(n):
    while n>1:
        n /= 10
    if n==1:
        return True
    return False

# num: 出力する数の始点
num = 1
K = int(input())
for i in range(K):
    print(num)
    if intlen(num) <= 3:
        if ispow10(num+1):
            if num!=999:
                num += 10**intlen(num)
            else:
                num += 100
        else:
            num += 10**(intlen(num)-1)
    elif intlen(num) <= 12:
        if num//(10**(intlen(num)-2)) <= (intlen(num)-3)*10 + 8:
            num += 10**(intlen(num)-2)
        else:
            num += 10**(intlen(num)-1)
    else:
        num += 10**(intlen(num)-1)

Submission status: Wrong Answer

Solution code:
#coding:utf-8
K = int(input())
K += 1
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())
if K <= 9:
    for i in range(1,K+1): print(i)
else:
    for i in range(1,10): print(i)
    K-=9    
    cnt = 1
    while 1:
        ret = ""
        for i in range(cnt):
            ret += "9"
        for i in range(1,10):
            print(str(i) + ret)
            K-=1
            if K==0: break
        cnt += 1
        if K==0: break

Submission status: Wrong Answer

Solution code:
K = int(input())
sunuke = list(range(1, 10))


def value(n):
    S = sum(map(int, list(str(n))))
    return n / S


def conmbine(left, nine_digits):
    return int(str(left) + str(9) * nine_digits)


if K <= 9:
    for i in range(K):
        print(sunuke[i])
else:
    prev = 1
    nine_digits = 1
    left = 1
    k = 9
    x = conmbine(left, nine_digits)
    v = value(x)
    while True:
        if prev <= v:
            sunuke.append(x)
            prev = v
            k += 1
            left += 1
            x = conmbine(left, nine_digits)
            v = value(x)
            if k == K:
                break
        else:
            nine_digits += 1
            left = 1
            x = conmbine(left, nine_digits)
            v = value(x)
    for i in range(K):
        print(sunuke[i])

Submission status: Wrong Answer

Solution code:
K = int(input())
sunuke_num = [0] * 100000
for num in range(1, 100001):
    sunuke_num[num-1] = num / sum([int(i) for i in list(str(num))])

for i in range(len(sunuke_num)-1):
    flg = 1
    for j in range(i + 1, len(sunuke_num)):
        if sunuke_num[i] > sunuke_num[j]:
            flg = 0
            break
    if flg:
        K -= 1
        print(i+1)
        if K == 0:
            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-2:
        break
    if str(n)[0:1]=="9":
        zouka=zouka*10
    print(n)
    
    count+=1

Submission status: Wrong Answer

Solution code:
K=int(input())
if K>200:
    K=200
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:
k = 0
K = int(input())
for i in range(9):
        if k >= K:
            break
        print(i+1)
        k += 1
if K>9:
    while k < K:
        print(9 +10*(k-8))
        k += 1

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==10**j-1:
            j+=1
for i in range(k):
    print(ans[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 count(2):
        for n in range(i-1, i*10-1):
            if j == 0: return
            print(str(n)+('9'*i))
            j -= 1

f()

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
i=0
while True:
	i+=1
	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:
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
    if i >= 9999999999999999: num = 10000000000000000

    print(i)
    h -= 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())

i = 1
j = 0

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

    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

i = 1
c = 1
while c <= K:
    if i <= 9:
        print(i)
        i += 1
        c += 1
    else:
        n = 9 + 10 * (i - 9)
        n_ = 9 + 10 * (i - 10)
        if n / sum(list(map(int, str(n)))) >= n_ / sum(list(map(int, str(n_)))):
            print(n)
            c += 1
        i += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
def S(n):
    return sum([int(i) for i in str(n)])
a = list(range(1, 10))

k = 19
for i in range(K):
    if i < 9:
        print(a[i])
    else:
        print(k)
        if k<99:
            k+=10
        else:
            k = k * 10 + 9

Submission status: Wrong Answer

Solution code:
K = int(input())

TOP = [10,11,12,13,14,15,16,17,18,19,29,39,49,59,69,79,89,99]

for i in range(1, K+1):
    if i <= 27:
        top = i % 9
        digit = i // 9
        nines = 0
        if digit > 0:
            nines = int('9' * digit)
        print((top * 10 ** digit) + nines)
    else:
        digit = (i - 27 - 1) // 18 + 3
        top_i = (i - 27 - 1) % 18
        top = TOP[top_i]
        nines = int('9' * (digit - 1))
        print((top * 10 ** (digit - 1)) + nines)

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 < 1999:
				totalsum = 19
			elif i < 19999:
				totalsum = 28
			elif i < 199999:
				totalsum = 37
			else:
				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:
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:
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(len(Sn)):
	print(Sn[i])