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:
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 k in range(j, j+10**i, 10**(i-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=(K-1)//9
B=(K-1)%9
if(K>18):
    B=8

j=1
count=18
if(A<1):
    for i in range(1,B+2):
        print(i)
else:
    for i in range(1,10):
        print(i)
    for i in range(1,B+2):
        i_str = str(i)
        print(i_str+"9")
    if(K>18):
        while(count<K):
            j_str = str(j)
            print(j_str+"99")
            count=count+1
            j=j+1

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) // 18 + 3
        top_i = (i - 27) % 18
        top = TOP[top_i]
        nines = int('9' * (digit - 1))
        print((top * 10 ** (digit - 1)) + nines)

Submission status: Wrong Answer

Solution code:
import math as m
K = int(input())
now = 1
while K > 0:
    if now < 10:
        print(now)
        K -= 1
        if now == 9:
            now += 10
        else:
            now += 1
    else:
        strNow = str(now)
        # flag = False
        # for i in range(1,len(strNow)):
        #     if strNow[i] != '9':
        #         flag = True
        #         break
        # if flag == True:
        #     continue
        print(now)
        # S = 0
        # for i in range(len(strNow)):
        #     S += int(strNow[i])
        # print(int(now / S), now)
        K -= 1
        if now < 100:
            now += 10
            if now == 109:
                now = 199
            continue
        if now < 1000:
            now += 100
            continue
        if strNow[0] == '1' and strNow[1] == '9':
            now += int(m.pow(10,len(strNow)-1)) * 9
        else:
            now += int(m.pow(10,len(strNow)-2))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!

k = int(input())

count=0
nine = ""
for i in range((k//9)+1):
    for i in range(1,10):
        if(count==k):
            break
        count+=1
        print(str(i)+nine)
    nine+="9"

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 13 <= now:
      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:
K = int(input())

if K < 10:
    for i in range(K):
        print(i + 1)
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:
MAX = 10**15+1

def top(num):
    ans = 0
    while num//10 != 0:
        ans += num%10
        num = num//10
    return num


def tail(num):
    sho = num//10
    return num-10*sho

def get_snuke():
        for i in range(1,MAX):
            if i <= 10:
                yield i
            elif  tail(i) == 9:
                if top(i) != top(i+10):
                    yield i
    

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

    
    for _ in range(K):
        snuke_num = gen.__next__()
        print(snuke_num)

if __name__ == "__main__":
    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(map(lambda x: int(str(x) + '9'), range(1, k)))

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

Submission status: Wrong Answer

Solution code:
k = int(input())

def digsums(x):
    s = str(x)
    sl = list(s)
    dig_sums = 0
    for i in sl:
        dig_sums += int(i)
    return dig_sums
    
    
if k <= 9 :
    roop = k
    for i in range(1,k+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    memo = 1
    count = 0
    for i in range(19,100000000,10):
        if i / digsums(i) < (i+100)/digsums(i+100) and i / digsums(i) < (i+10)/digsums(i+10) and memo < (i/digsums(i)) :
            print(i)
            memo = (i/digsums(i))
            count +=1
        if count == k:
            break

Submission status: Wrong Answer

Solution code:
K_s = input()
sum = 0
for letter in K_s:
    sum = sum + int(letter)
K = int(K_s)
for n in range(1, K//sum):
    print(n)
count = K//sum-1
if K%sum !=0:
    print(n+1)
    count = count +1
i=2
while count < K:
    for j in reversed(range(sum*i)):
        if count == K:
            break
        print(K*i-j)
        count = count + 1
    i=i+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 solve():
    k = int(input())
    n = 1
    while k != 0:
        nsum = get_sum(n)
        next_n = n + 1
        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:
K = int(input())


count1=0
count2=1
answer = []

for i in range(K):
    a = (10**count1)* (count2+1) -1
    
    answer.append(a)
    count2 += 1
    if count2 == 10:
        count1 += 1
        count2 =1

for aa in answer:
    print(aa)

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
c = 0
b = 1
for i in range(K):
    if i < 9:
        print(a[i])
    else:
        print(k)
        k+=10**b
        c += 1
        if c == 8:
            b += 1
            c = 0

Submission status: Wrong Answer

Solution code:
def a():
    for i in range(0,15):
        for k in range(2,11):
            yield((10**i)*k - 1)

K = int(input())
cnt = 0
for p in a():
    cnt += 1
    if cnt > K:break
    print(p)

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

k = int(input())
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
			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())
# if k < 10:
#     print(k)
#     exit()

def s(n):
    return sum(list(map(int, str(n))))

seeds = [i for i in range(1, 10)]
for i in range(15):
    for j in range(10):
        for m in range(10):
            seeds.append(int(str(m + j*10) + str(9)*i))

# print(seeds)

seeds = [i for i in seeds if i!=0]

l = []
for i in seeds:
    l.append([i, s(i), i/s(i)])

# for i in range(1, 10**6):
#     l.append([i, s(i), i/s(i)])


l.sort(key=lambda x:x[2])
# for i in range(len(l)):
#     print(l[i])

max = 0
ans = []
for i in range(len(l)):
    if l[i][0] > max:
        max = l[i][0]
        ans.append(l[i][0])
        # print(l[i][0], end=" ")

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

# max = 0
# for i in range(len(l)):
#     if l[i][0] > max:
#         max = l[i][0]
#         print(l[i][0]+1, end=" ")
# print()

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())
for i in range(1, k + 1):
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())
n = 0

for i in range(1,1000000000000001):
  if i <= 9 :
    print(i)
    n += 1
  else :
    i_s = str(i)
    if i_s[len(i_s)-1] == '9' :
      print(i)
      n += 1
  if n == k :
    break

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0

for j in range(100):
    for i in range(9):
        print(str(i+1) + ('9'*j))
        cnt += 1
        if cnt >= n:
            break
    if cnt >= n:
        break

Submission status: Wrong Answer

Solution code:
import numpy as np

K = int(input())

digit = 0
top = 1
flag = 0

while True:
    if flag == K:
        exit()
    print(top * 10 ** digit + 10 ** digit - 1)
    flag += 1
    top += 1
    if top == 10:
        top = 1
        digit += 1

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__":
    K = int(input())
    n = 0
    Sn = [0] # 添字0は便宜上埋めておく
    RANGE_ = 50
    while n != RANGE_:
        n += 1
        Sn.append(eval_sn(n))

    while K != 0:
        n += 1
        #
        Sn.append(eval_sn(n))
        check = 0
        for j in range(RANGE_):
            if (Sn[n-RANGE_] <= Sn[n-j]):
                check += 1
                continue
            else:
                break
        if check == RANGE_:
            K -= 1
            print(n-RANGE_)

Submission status: Wrong Answer

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

K = int(input())

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:
k = int(input())
n = 0

for i in range(1,1000000000000000):
  if i <= 9 :
    print(i)
    n += 1
  else :
    i_s = str(i)
    if i_s[len(i_s)-1] == '9' :
      print(i)
      n += 1
  if n == k :
    break

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__":
    K = int(input())
    n = 0
    Sn = [0] # 添字0は便宜上埋めておく
    RANGE_ = 11
    while n != RANGE_:
        n += 1
        Sn.append(eval_sn(n))

    while K != 0:
        n += 1
        #
        Sn.append(eval_sn(n))
        check = 0
        for j in range(RANGE_):
            if (Sn[n-RANGE_] <= Sn[n-j]):
                check += 1
                continue
            else:
                break
        if check == RANGE_:
            K -= 1
            print(n-RANGE_)

Submission status: Wrong Answer

Solution code:
k = int(input())
a = list()
i = 1
j = 0
if k > 135:
    k = 135
while i <= k:
    if i % 9 != 0:
        a.append((i % 9 + 1) * 10 ** j - 1)
    else:
        j += 1
        a.append(10 ** j -1)
    i += 1

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

Submission status: Wrong Answer

Solution code:
n = int(input())
cnt = 0

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

Submission status: Wrong Answer

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


if k <= 9:
    for i in a:
        print(i)
        k -= 1
        if k == 0 :
            break
else:
    for i in a:
        print(i)
    k -= 9
    start = 2
    off = 10
    while True:
        if k == 0:
            break
        if start == 11:
            start = 2
            off = off * 10
        print( start * off - 1)
        start += 1
        k -= 1

Submission status: Wrong Answer

Solution code:
k = int(input())

second_num = 0
second_counter = 10
second_base = 9


top_counter = 1
base_counter = 9

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

        print("{}{}".format(top_counter, base_counter))
        top_counter += 1

        if top_counter >= 10:
            top_counter = 1
            base_counter *= 10
            base_counter += 9

Submission status: Wrong Answer

Solution code:
import math 
def S(N):
    s = 0
    n = N
    while n != 0:
        s += n % 10
        n /= 10
        n = math.floor(n)
    return s

def t(N):
    # print("N", N)
    # print("SN", S(N))
    return N / S(N)

def isSnuke(n):
    if n == 1:
        return True

    first = n % 10
    firstIsNine = n + 9 - first

    second = int(n / 10) % 10
    firstSecondIsNine = firstIsNine + 90 - second * 10

    third = int(n / 100) % 10
    firstSecondThirdIsNine = firstSecondIsNine + 900 - third * 100
    m = 1
    while m <= n:
        m *= 10
    m -= 1
    
    checkers = range(firstIsNine, firstSecondThirdIsNine, 10)
    # print(checkers)
    for c in checkers:
        if t(n) > t(c):
            return False
    return True
    
#     # print(firstIsNine)
#     if t(n) > t(firstIsNine):
#         return False
#     nVal = n / S(n)
#     
#     mVal = m / S(m)
#     return (nVal <= mVal)
# 
def listSnuke(k):
    n = 0
    number = 0
    while number < k:
        n += 1
        if isSnuke(n):
            print(n)
            number += 1

listSnuke(int(input()))

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
K = int(input())

for n in range(K):
    i = int(n // 9)
    r = n % 9

    print((r+2)*(10**i) - 1)

Submission status: Wrong Answer

Solution code:
K = int(input())

for i in range(1, K + 1):
    moji = ''
    margin = i % 9
    sho = i // 9
    if i > 27:
        moji += str(i - 28 + 10)
        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:
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+9:
        #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
        
for i in x:
    print(i)

Submission status: Wrong Answer

Solution code:
K = int(input())

i = 1
n = 0
cnt = 1
while cnt <= K:
    x = str(i) + '9' * n
    print(x)
    i += 1
    if int(x) >= 999:
        if i > 10:
            i = 1
            n += 1
    else:
        if i > 9:
            i = 1
            n += 1
    cnt += 1

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'

Submission status: Wrong Answer

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

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

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

l = []
for i in range(1, 100000):
    l.append([i, snuke(i)])

l = sorted(l, key=lambda l: l[1])

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

Submission status: Wrong Answer

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

def s(n):
    return sum(list(map(int, str(n))))

seeds = [i for i in range(1, 10)]
for i in range(15):
    for j in range(1, 10):
        for m in range(10):
            seeds.append(int(str(m + j*10) + str(9)*i))

# print(seeds)

# seeds = list(map(lambda x:x-1, seeds))

l = []
for i in seeds:
    l.append([i, s(i), i/s(i)])

# for i in range(1, 10**6):
#     l.append([i, s(i), i/s(i)])


l.sort(key=lambda x:x[2])
# for i in range(len(l)):
#     print(l[i])

max = 0
ans = []
for i in range(len(l)):
    if l[i][0] > max:
        max = l[i][0]
        ans.append(l[i][0])
        # print(l[i][0], end=" ")

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

# max = 0
# for i in range(len(l)):
#     if l[i][0] > max:
#         max = l[i][0]
#         print(l[i][0]+1, end=" ")
# print()

Submission status: Wrong Answer

Solution code:
k=int(input())
m=2
sm=1
pre=0
while sm<=k:
    l=list(str(m))
    sn=0
    for i in l:
        sn=sn+int(i)
    if m/sn>=pre:
        sm=sm+1
        print(m-1)
    pre=m/sn
    m=m+1

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:
import math 
def S(N):
    s = 0
    n = N
    while n != 0:
        s += n % 10
        n /= 10
        n = math.floor(n)
    return s

def t(N):
    # print("N", N)
    # print("SN", S(N))
    return N / S(N)

def isSnuke(n):
    if n == 1:
        return True

    first = n % 10
    firstIsNine = n + 9 - first

    second = int(n / 10) % 10
    firstSecondIsNine = firstIsNine + 90 - second * 10
    m = 1
    while m <= n:
        m *= 10
    m -= 1
    
    checkers = range(firstIsNine, firstSecondIsNine, 10)
    # print(checkers)
    for c in checkers:
        if t(n) > t(c):
            return False
    return True
    
#     # print(firstIsNine)
#     if t(n) > t(firstIsNine):
#         return False
#     nVal = n / S(n)
#     
#     mVal = m / S(m)
#     return (nVal <= mVal)
# 
def listSnuke(k):
    n = 0
    number = 0
    while number < k:
        n += 1
        if isSnuke(n):
            print(n)
            number += 1

listSnuke(int(input()))

Submission status: Wrong Answer

Solution code:
k=int(input())
for i in range(k):
  print(str(i%9+1).ljust(i//9+1,"9"))

Submission status: Wrong Answer

Solution code:
k = int(input())

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

start = 1
counter = 0

while counter < k:
    if sunuke(start) <= sunuke(start + 1) and sunuke(start) <= 10 ** 15:
        print(start)
        counter += 1

    start += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

count = 1
i = K // 9

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

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
K = int(input())

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

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

l = []
for i in range(1, K+1):
    l.append([i, snuke(i)])

l = sorted(l, key=lambda l: l[1])

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def keta(num):
	nums = []
	while(num != 0):
		nums.append(num%10)
		num//=10
	return sum(nums)

K = int(input())
count = 0
i = 1
while(True):
	if(i/keta(i) <= (i+1)/keta(i+1)):
		print(i)
		count += 1
	if(count == K):
		break
	i += 1

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)
  K-=9
  cnt=0
  ans=9
  po=1
  while True:
    for i in range(9):
      ans+=10**po
      print(ans)
      cnt+=1
      if cnt==K:
        break
    if cnt==K:
      break
    else:
      po+=1

Submission status: Wrong Answer

Solution code:
def a():
    for i in range(0,16):
        for k in range(2,11):
            yield((10**i)*k - 1)

K = int(input())
cnt = 0
for p in a():
    cnt += 1
    if cnt > K:break
    print(p)

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

def sum_digit(num):
    strnum = str(num)
    sumdig = 0
    for d in strnum:
        sumdig += int(d)
    return num / sumdig

s = []
i = 1
while True:
    if len(s) == k:
        break
    if sum_digit(i) <= sum_digit(i+1):
        s.append(i)
        print(i)
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
K=int(input())
if 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 = int(input())
result_list = []
for i in range(1,K+1):
    result = 0
    a = i // 9
    b = i % 9
    for j in range(0,a):
        result += 9 * (10 ** j)
    result += b * (10 ** a)
    print(result)

Submission status: Wrong Answer

Solution code:
K=int(input())
n=int(K/10)
#print(n)
for i in range(1,K+n+1):
    if i<=9:
        print(i)
    elif i%10==0:
        pass
    elif i<=19:
        a=(i-10)*10+9
        print(a)
    elif i<=29:
        a=(i-20)*100+99
        print(a)
    elif i<=39:
        a=(i-30)*1000+999
        print(a)
    elif i<=49:
        a=(i-40)*10000+9999
        print(a)
    elif i<=59:
        a=(i-50)*100000+99999
        print(a)
    elif i<=69:
        a=(i-60)*1000000+999999
        print(a)
    elif i<=79:
        a=(i-70)*10000000+9999999
        print(a)
    elif i<=89:
        a=(i-80)*100000000+99999999
        print(a)
    elif i<=99:
        a=(i-90)*1000000000+999999999
        print(a)
    elif i<=109:
        a=(i-100)*10000000000+9999999999
        print(a)
    elif i<=119:
        a=(i-110)*100000000000+99999999999
        print(a)
    elif i<=129:
        a=(i-120)*1000000000000+999999999999
        print(a)
    elif i<=139:
        a=(i-130)*10000000000000+9999999999999
        print(a)
    elif i<=149:
        a=(i-140)*100000000000000+99999999999999
        print(a)
    elif i<=159:
        a=(i-150)*1000000000000000+999999999999999
        print(a)

Submission status: Wrong Answer

Solution code:
K = int(input())
m = K//9 + 1
L = list(range(1, 10))
for i in range(1, m):
    l = len(L)
    M = L[l-9:]
    A = [x*10+9 for x in M]
    L.extend(A)
for i in range(K):
    print(L[i])

Submission status: Wrong Answer

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

def s(n):
    return sum(list(map(int, str(n))))

seeds = [i for i in range(2, 10)]
for i in range(16):
    for j in range(1, 10):
        for m in range(10):
            seeds.append((m + j*10) * 10**i)

# print(seeds)

seeds = list(map(lambda x:x-1, seeds))

l = []
for i in seeds:
    l.append([i, s(i), i/s(i)])
#
l.sort(key=lambda x:x[2])
# for i in range(len(l)):
#     print(l[i])

max = 0
ans = []
for i in range(len(l)):
    if l[i][0] > max:
        max = l[i][0]
        ans.append(l[i][0])
        # print(l[i][0], end=" ")

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

# max = 0
# for i in range(len(l)):
#     if l[i][0] > max:
#         max = l[i][0]
#         print(l[i][0]+1, end=" ")
# print()

Submission status: Wrong Answer

Solution code:
K = int(input())
i = 1
if K <= 8:
    while i <= K:
        print(i)
        i += 1
elif K > 8:
    while i <= 8:
        print(i)
        i += 1
    while 9 <= i <=K:
        a = i - 9
        sunuke = a * 10 + 9
        print(sunuke)
        i += 1

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
k = int(input())

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


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

if k >= 10:
    for i in range(1, min(k-9, 10)):
        print(str(i)+"9")
    if k >= 19:
        k = k - 18
        c = 199
        scc = S(199)/199
        while k > 0:
            cp = c+100
            scpcp = S(cp)/cp
            if scc >= scpcp:
                print(c)
            c, scc = cp, scpcp
            k -= 1

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 0
n = 1
while True:
    if i == k:
        break
    if n < 10:
        print(n)
        i += 1
        n += 1
        continue
    sn = 0
    sm = 0
    m = n+1
    for a in list(str(n)):
        sn += int(a)
    for b in list(str(m)):
        sm += int(b)
    left = n/sn
    
    if left <= m/sm and m*(sm+1) > sm*(m+1):
        i += 1
        print(n)
    
    n += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
K = min(K, 135)
L = list(range(1, 10))
for i in range(1, 15):
    l = len(L)
    M = L[l-9:]
    A = [x*10+9 for x in M]
    L.extend(A)
for i in range(K):
    print(L[i])

Submission status: Wrong Answer

Solution code:
K = int(input())
result_list = []
for i in range(1,K+1):
    result = 0
    a = i // 9
    b = i % 9
    for j in range(0,a):
        result += 9 * (10 ** j)
    result += b * (10 ** a)
    if result <= 10**15:
        result_list.append(result)
for i in result_list:
    print (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"
    zu = "9"
    for i in range(k - 9):
        if i % 3 == 0:
            ge += "9"
            print(ge)
        elif i % 3 == 1:
            do += "0"
            print(do)
        else:
            zu += "9"
            print(zu)

Submission status: Wrong Answer

Solution code:
import math 
def S(N):
    s = 0
    n = N
    while n != 0:
        s += n % 10
        n /= 10
        n = math.floor(n)
    return s

def t(N):
    # print("N", N)
    # print("SN", S(N))
    return N / S(N)

def isSnuke(n):
    if n == 1:
        return True

    first = n % 10
    firstIsNine = n + 9 - first
    # print(firstIsNine)
    if t(n) > t(firstIsNine):
        return False
    nVal = n / S(n)
    
    m = 1
    while m < n:
        m *= 10
    m -= 1
    mVal = m / S(m)
    return (nVal <= mVal)

def listSnuke(k):
    n = 0
    number = 0
    while number < k:
        n += 1
        if isSnuke(n):
            print(n)
            number += 1

listSnuke(int(input()))

Submission status: Wrong Answer

Solution code:
k = int(input())
a = list()
i = 1
j = 0
while i <= k:
    if i % 9 != 0:
        a.append((i % 9 + 1) * 10 ** j - 1)
    else:
        j += 1
        a.append(10 ** j -1)
    i += 1
for i in range(len(a)):
    print(a[i])

Submission status: Wrong Answer

Solution code:
K = int(input())

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

for i in range(1,K+1):
	if snuke(i) < 10**15:
		print(snuke(i))

Submission status: Wrong Answer

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

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

i = 10
while True:
    for j in range(1, 10):
        sunukes.append(j * i)
    if len(sunukes) >= k:
        break        
    i *= 10

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

Submission status: Wrong Answer

Solution code:

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

if __name__ == "__main__":
    K = int(input())
    n = 0
    Sn = [0] # 添字0は便宜上埋めておく
    while n != 10:
        n += 1
        Sn.append(eval_sn(n))

    while K != 0:
        n += 1
        #
        Sn.append(eval_sn(n))
        check = 0
        for j in range(10):
            if (Sn[n-10] <= Sn[n-j]):
                check += 1
                continue
            else:
                break
        if check == 10:
            K -= 1
            print(n-10)