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

s = []
digit = math.ceil(K / 9)
ans = 0
cnt = 0
for i in range(digit):
    a = str(10**(i)-1) if i != 0 else ''
    for j in range(1, 10):
        if cnt == K:
            break
        ans = str(j)+a
        print(ans)
        cnt += 1

Submission status: Wrong Answer

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

s = []
digit = math.ceil(K / 9)
ans = 0
for i in range(digit):
    a = str(10**(i)-1) if i != 0 else ''
    for j in range(1, 10):
        ans = str(j)+a
        print(ans)

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(1, 9):
        print(i)

    for i in range(K-8):
        ans = i*10 + 9
        print(ans)

Submission status: Wrong Answer

Solution code:
k = int(input())
candili = []
for i in range(1, 1000):
    candili.append(i)

tmpli = []
for i in candili:
    for j in range(1, 15):
        tmpli.append(int(str(i) + "9" * j))
tmpli = list(set(tmpli))

tmp2li = []
for i in tmpli:
    if i <= 10 ** 15:
        tmp2li.append(i)
candili += tmp2li
candili.sort()

def S(n):
    return sum(int(i) for i in str(n))

conli = []

for i in candili:
    conli.append(i/S(i))

ansli = []
for i in range(len(conli)):
    for j in range(i, len(conli)):
        if conli[i] > conli[j]:
            break
    else:
        ansli.append(candili[i])

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

Submission status: Wrong Answer

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def s(n):
    ret = 0
    while n:
        ret += n % 10
        n = n // 10
    return ret


def main():
    k = intin()

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

    k = k - 9
    if k <= 0:
        return

    for i in range(1, 15):
        base = int('9' * i)
        prev = base / s(base)
        msnumer = 1

        while True:
            m = msnumer * (10**i) + base
            left = m / s(m)
            if left >= prev:
                print(m)
                k -= 1
                if k <= 0:
                    return
            else:
                break
            prev = left
            msnumer += 1


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    k = intin()

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

    if k < 9:
        return

    k = k - 9

    for i in range(k):
        print('%d9' % ((i + 1), ))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy
from collections import defaultdict


mod = 1


def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def combination(x, y):
    assert(x >= y)

    if y > x // 2:
        y = x - y

    ret = 1

    for i in range(0, y):
        j = x - i
        i = i + 1

        ret = ret * j
        ret = ret // i

    return ret


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def get_factors(x):
    retlist = []
    for i in range(2, int(x**0.5) + 3):
        while x % i == 0:
            retlist.append(i)
            x = x // i
    retlist.append(x)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    k = intin()

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

    k = k - 9

    for i in range(k):
        print('%d9' % ((i + 1), ))


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
K = int(input())

def snuke(val):
    divisor = sum(map(int, list(str(val))))
    return val / divisor

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

s = 9
if K > 8:
    for i in range(9, K+1):
        if snuke(s) < snuke(s+10):
            print(s)
        s += 10

Submission status: Wrong Answer

Solution code:
K=int(input())
sunuke=1
print(sunuke)
for i in range(K-1):
    I=i+1
    It=int(I/9)
    sunuke+=10**It
    print(sunuke)

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 1
n = 1
sum = 1
while n <= k:
    s = i + 1
    nextsum = 0
    while s >= 10:
        nextsum = nextsum + s % 10
        s = int(s/10)
    nextsum = nextsum + s
    #print(i/sum)
    #print(i+1/nextsum)
    if (i/sum) <= ((i+1)/nextsum):
        print(i)
        n = n + 1
    i = i + 1
    sum = nextsum
    #print(nextsum)

Submission status: Wrong Answer

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

	for i in range(K):
		dev = i // 9
		mod = i % 9
		ans = str(mod+1)
		ans += "9"*dev
		print(ans)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
a=[i for i in range(1,9)]

last=""
for i in range(1,16):
    last+="9"
    for j in range(i-1,10*i):
        a.append(int(str(j)+last))

K=int(input())
for i in range(K):
    print(a[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
INF = float("inf")
from queue import Queue


def solve(K: int):
    q = Queue()
    for i in range(1, 10):
        q.put(str(i))

    for _ in range(K):
        c = q.get()
        print(c)
        q.put(c+"9")
    # for i in range(99, 300, 10):
    #     if not i % 10 == 9:
    #         continue
    #     s = str(i)
    #     S = sum([int(c) for c in s])
    #     print(i, i/S)

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    K = int(next(tokens))  # type: int
    solve(K)


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
K = int(input())
i = 1
s = ""
for _ in range(K):
    print(str(i)+s)
    i += 1
    if i == 10:
        s += "9"
        i = 1

Submission status: Wrong Answer

Solution code:

N = input()
K = int(N)
li = list(map(int, N))

s = sum(li)

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

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

K = INT()
p = 0
counter = 1
for _ in range(K):
	print(10**p*(counter+1)-1)
	counter += 1
	if counter % 10 == 0:
		counter = 1
		p += 1

Submission status: Wrong Answer

Solution code:
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

K = INT()

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

Submission status: Wrong Answer

Solution code:
K = int(input())


def f(n):
    return n / sum([int(s) for s in str(n)])


n = 1
ans = []
while len(ans) < K:
    min_f_val, next_n = float('inf'), n
    for i in range(len(str(n))):
        x = str(n)[:len(str(n)) - i] + '9' * i

        f_val = f(int(x))
        if f_val < min_f_val:
            next_n = int(x, base=10)

    ans.append(next_n)
    n = max(n + 1, next_n)

print(*ans, sep='\n')

Submission status: Wrong Answer

Solution code:
def main():
    N = int(input())
    base = ""
    i = 1
    last = ""
    while N > 0:
        print(str(i) + base)
        # last = str(i) + base
        i += 1
        if i == 10:
            i = 1
            base += "9"
        N-=1
    # print(len(last))
if __name__ == "__main__":
    main()

Submission status: Wrong Answer

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

#A
def A():
    return

#B
def B():
    return

#C
def C():
    return

#D
def D():
    k = I()
    ans = [1,2,3,4,5,6,7,8,9]
    i = 1
    p = 10
    while len(ans) < k:
        s = 0
        for j in range(i):
            s *= 10
            s += 9
        for j in range(1,10):
            ans.append(s+j*p)
        i += 1
        p *= 10
    for i in range(k):
        print(ans[i])
    return

#E
def E():
    return

#F
def F():
    return

#G
def G():
    return

#H
def H():
    return

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

Submission status: Wrong Answer

Solution code:
K = int(input())

#すぬけ数候補
# [数値, すぬけ数] で覚える
snukePairs = []

for i in range(1, 16):
    top = 1  #上位何桁を走査範囲とするか
    if i >= 12:
        top = 3
    elif i >= 5:
        top = 2
    p = pow(10, i - top)
    fill9 = p - 1
    top_num = pow(10, max(top, 1)) #たかが1000。全部回す
    check_index = len(snukePairs)
    for j in range(1, top_num):
        num = j * p + fill9
        nn = num
        s = 0
        #各桁の合計
        while nn > 0:
            s += nn % 10
            nn = nn // 10
        val = num / s

        #既存のもののうち、valより小さいものを除外。ただし速度のため同一桁限定
        #もちょい効率いい方法ないかな...
        idx = len(snukePairs) - 1
        while idx >= check_index:
            if snukePairs[idx][1] > val:
                del snukePairs[idx]
            idx -= 1
        snukePairs.append([num, val])

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

Submission status: Wrong Answer

Solution code:
K=int(input())
for i in range(1,min(9,K)):
  print(i)
K-=8
j=1
while K>0:
  for i in range(1,min(9,K)+1):
    print(i*10**j-1)
  K-=10
  j+=1

Submission status: Wrong Answer

Solution code:
K=int(input())
for i in range(1,min(8,K)):
  print(i)
K-=8
j=1
while K>0:
  for i in range(1,min(9,K)+1):
    print(i*10**j-1)
  K-=10
  j+=1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())

n = 0
for i in range(k):
  num = str(i%9 + 1) + "9" * n
  # S = 0
  # for c in num:
  #   S += int(c)
  # print(int(num) / S)
  print(num)
  if i%9 == 8:
    n+=1

Submission status: Wrong Answer

Solution code:
k = int(input())
s = [1,2,3,4,5,6,7,8]
if k > 8:
    for i in range(0, k-8):
        ans = i*10 + 9
        s.append(ans)
for i in s:
    print(i)

Submission status: Wrong Answer

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

while k > 0:
    for i in range(1, min(k, 9) + 1):
        print(str(i) + "9" * c)
    k -= min(k, 9)
    c += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

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

for i in range(2, k + 2):
    print(10 * i - 1)

Submission status: Wrong Answer

Solution code:
K = int(input())

k = K
surfix = ""
num = 1
for i in range(1, K + 1):
    a = str(num) + surfix
    print(a)
    num += 1
    if num == 10:
        num = 1
        surfix += "9"

Submission status: Wrong Answer

Solution code:
k = int(input())
if k<10:
    for i in range(k):
        print(i+1)
else:
    for i in range(9):
        print(i+1)
    i = 0
    m = 1
    while i<k-9:
        for j in range(1,10):
            print(str(j)+'9'*m)
            i+=1
            if i==k-9:
                break
        m+=1

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(str(i+1)+'9')

Submission status: Wrong Answer

Solution code:
k = int(input())

cnt = 0
loop = 0
stage = 0
base = 1
tail = ""
while 1:
    for i in range(1,10):
        print(str(i)+tail)
        cnt += 1
        if cnt ==k:
            exit(0)
    tail+='9'

Submission status: Wrong Answer

Solution code:
k = int(input())

def func(a):
    s = 0
    for i in str(a):
        s += int(i)
    return a/s

candidate_lst = []
for i in range(18):
    for j in range(1, 150):
         candidate_lst.append(int(str(j) + '9' * i))
candidate_lst = sorted(candidate_lst)

count = 0
index = -1
snuke = 1
while count < k:
    min_snuke = 10**100
    for m, i in enumerate(candidate_lst[index+1:]):
        if i > 100*snuke:
            break
        po_snuke = func(i)
        if min_snuke > po_snuke:
            min_snuke = po_snuke
            next_snuke = i
            next_index = m
    print(next_snuke)
    snuke = next_snuke
    index = index + next_index + 2
    count += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

def func(a):
    s = 0
    for i in str(a):
        s += int(i)
    return a/s

candidate_lst = []
for i in range(18):
    for j in range(1, 150):
         candidate_lst.append(int(str(j) + '9' * i))
candidate_lst = sorted(candidate_lst)

count = 0
index = -1
snuke = 1
while count < k:
    min_snuke = 10**100
    for m, i in enumerate(candidate_lst[index+1:]):
        if i > 100*snuke:
            break
        po_snuke = func(i)
        if min_snuke > po_snuke:
            min_snuke = po_snuke
            next_snuke = i
            next_index = m
    print(next_snuke)
    snuke = next_snuke
    index = index + next_index + 1
    count += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

def func(a):
    s = 0
    for i in str(a):
        s += int(i)
    return a/s

candidate_lst = []
for i in range(16):
    for j in range(1, 150):
         candidate_lst.append(int(str(j) + '9' * i))
candidate_lst = sorted(candidate_lst)

count = 0
index = -1
snuke = 1
while count < k:
    min_snuke = 10**100
    for m, i in enumerate(candidate_lst[index+1:]):
        if i > 100*snuke:
            break
        po_snuke = func(i)
        if min_snuke > po_snuke:
            min_snuke = po_snuke
            next_snuke = i
            next_index = m
    print(next_snuke)
    snuke = next_snuke
    index = index + next_index + 1
    count += 1

Submission status: Wrong Answer

Solution code:
def S(n: int) -> int:
    """n を十進法で表した時の各桁のあたいの総和
    :param n: 任意の正の整数
    :return: 十進法の各桁の和
    """
    s = 0
    while n > 0:
        s += n % 10
        n //= 10
    return s


if __name__ == "__main__":
    K = int(input())
    i = 1
    step = 1
    for _ in range(K):
        if i == 10:
            i = 1
            step *= 10
        print((i + 1) * step - 1)
        i += 1

Submission status: Wrong Answer

Solution code:
k = int(input())
count = 0
top = '1'
keta = ''
while count < k:
    count += 1
    print(str(top)+keta)
    if int(top) != 9:
        top = str(int(top)+1)
    else:
        top = '1'
        keta += '9'

Submission status: Wrong Answer

Solution code:
def s(x):
    a = str(x)
    b = 0
    for k in range(len(a)):
        b += int(a[k])
    return b

k = int(input())
cnt = 0
i = 1

while cnt < k:
    c = 0
    j = i+1
    while j < i + 11:
        if i/s(i) <= j/s(j):
            c += 1
            j += 1
        else:
            break
    if c == 10:
        print(i)
        cnt += 1
    i += 1

Submission status: Wrong Answer

Solution code:
def s(x):
    a = str(x)
    b = 0
    for k in range(len(a)):
        b += int(a[k])
    return b

k = int(input())
cnt = 0
i = 1

while cnt < k:
    c = 0
    j = i+1
    while j < i + 10:
        if i/s(i) <= j/s(j):
            c += 1
            j += 1
        else:
            break
    if c == 9:
        print(i)
        cnt += 1
    i += 1

Submission status: Wrong Answer

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-

t = i = 1
k = int(input()) 

for _ in range(k):
  if t < i / sum(map(int, list(str(i)))):
    i += 9 * t
    t *= 10
  else:
    print(i)
    i += t

Submission status: Wrong Answer

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys


k = int(input())
step = ret = 1
for _ in range(k):
  if step < ret / sum(map(int, list(str(ret)))):
    ret += 9*step
    step *= 10
  else:
    print(ret)
    ret += step

Submission status: Wrong Answer

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys

def solve(k):
  step, ret, mx = 1, 0, 9
  for _ in range(k):
    ret += step
    if ret >= mx:
      step *= 10
      mx = mx*10 + 9
    print(ret)

k = int(input())
solve(k)

Submission status: Wrong Answer

Solution code:
# /user/bin/python
# -*- coding: utf-8 -*-
import sys

def solve(k):
  step = 1
  ret = 0
  mx = 9
  while k > 0:
    ret += step
    k -= 1
    if ret >= mx:
      step *= 10
      mx = mx*10 + 9
    print(ret)

k = int(input())
solve(k)

Submission status: Wrong Answer

Solution code:
K=int(input())
ans = '1'
for i in range(K):
    print(ans)
    if ans[0] == '9':
        ans = '1' + ans
    else:
        ans = str(int(ans[0])+1)+ans[1:]

Submission status: Wrong Answer

Solution code:
K = int(input())

#def sunuke_calc(i):
#    S = sum([int(c) for c in str(i)])
#    #print('num', i)
#    #print('sunuke', i/S)
#    return i / S

def sunuke_gen():
    i=1
    nine_num = 0
    while True:
        yield int(str(i) + '9'*nine_num)
        i+=1
        if i == (nine_num*10 if nine_num else 10):
            i=10**len(str(nine_num))
            nine_num += 1
            if nine_num == 1:
                i=1


for n, sunuke in enumerate(sunuke_gen(), start=1):
    print(sunuke)
    if n == K:
        exit()

Submission status: Wrong Answer

Solution code:
K = int(input())

#def sunuke_calc(i):
#    S = sum([int(c) for c in str(i)])
#    #print('num', i)
#    #print('sunuke', i/S)
#    return i / S

def sunuke_gen():
    i=1
    nine_num = 0
    i < nine_num*10
    while True:
        yield int(str(i) + '9'*nine_num)
        i+=1
        if nine_num <=2:
            if i == 10:
                i=1
                nine_num += 1
        else:
            if i == nine_num*10:
                i=10
                nine_num += 1


for n, sunuke in enumerate(sunuke_gen(), start=1):
    print(sunuke)
    if n == K:
        exit()
    

#for n in range(1, 100):
#    if all([sunuke_calc(n) <= sunuke_calc(m) for m in range(n, 10000)]):
#        sunuke_numbers.append(n)
#    if len(set(sunuke_numbers)) == K:
#        for s in set(sunuke_numbers):
#            print(s)
#        exit()

Submission status: Wrong Answer

Solution code:
K = int(input())

#def sunuke_calc(i):
#    S = sum([int(c) for c in str(i)])
#    #print('num', i)
#    #print('sunuke', i/S)
#    return i / S

def sunuke_gen():
    i=1
    nine_num = 0
    while True:
        yield int(str(i) + '9'*nine_num)
        i+=1
        if i == 10:
            i=1
            nine_num += 1

for n, sunuke in enumerate(sunuke_gen(), start=1):
    print(sunuke)
    if n == K:
        exit()
    

#for n in range(1, 100):
#    if all([sunuke_calc(n) <= sunuke_calc(m) for m in range(n, 10000)]):
#        sunuke_numbers.append(n)
#    if len(set(sunuke_numbers)) == K:
#        for s in set(sunuke_numbers):
#            print(s)
#        exit()

Submission status: Wrong Answer

Solution code:
k = int(input())
if(k <= 9):
    for x in range(k):
        print(x+1)
else:
    for x in range(9):
        print(x+1)

    for y in range(2,k-7):
        print(10*y-1)

Submission status: Wrong Answer

Solution code:
def snuke(a):
    res=0
    n=a
    while a>0:
        res+=a%10
        a//=10
    return float(n)/float(res)
K=int(input())
snuke_number=[i for i in range(1,10)]
s=snuke_number[-1]
for j in range(1,9+1):
    snuke_number.append(s+j*10)

s=snuke_number[-1]
for j in range(1,19+1):
    snuke_number.append(s+j*100)

for i in range(2,12):
    for j in range((i+1)*10-i):
        snuke_number.append(snuke_number[-1]+10**(i+1))

snuke_number_final=[]
for i in range(len(snuke_number)):
    f=1
    for s in snuke_number[i+1:]:
        if snuke(snuke_number[i])>snuke(s):
            f=0
            break
    if f==1:
        snuke_number_final.append(snuke_number[i])
print(snuke_number_final[:K])

Submission status: Wrong Answer

Solution code:
def snuke(a):
    res=0
    n=a
    while a>0:
        res+=a%10
        a//=10
    return float(n)/float(res)
K=int(input())
snuke_number=[i for i in range(1,10)]
s=snuke_number[-1]
for j in range(1,9+1):
    snuke_number.append(s+j*10)

s=snuke_number[-1]
for j in range(1,19+1):
    snuke_number.append(s+j*100)

for i in range(2,14):
    for j in range((i+1)*10-i):
        snuke_number.append(snuke_number[-1]+10**(i+1))

snuke_number_final=[]
for i in range(len(snuke_number)):
    f=1
    for s in snuke_number[i+1:]:
        if snuke(snuke_number[i])>snuke(s):
            f=0
            break
    if f==1:
        snuke_number_final.append(snuke_number[i])
print(snuke_number_final[:K])

Submission status: Wrong Answer

Solution code:
K=int(input())
snkue_number=[i for i in range(1,10)]
s=snkue_number[-1]
for j in range(1,9+1):
    snkue_number.append(s+j*10)

s=snkue_number[-1]
for j in range(1,19+1):
    snkue_number.append(s+j*100)

for i in range(2,15):
    for j in range((i+1)*10-i):
        snkue_number.append(snkue_number[-1]+10**(i+1))
print(snkue_number[:K])

Submission status: Wrong Answer

Solution code:
K=int(input())
snkue_number=[i for i in range(1,10)]
s=snkue_number[-1]
for j in range(1,9+1):
    snkue_number.append(s+j*10)
for i in range(1,10):
    s=snkue_number[-1]
    for j in range(i,(i)*10+9+1):
        snkue_number.append(s+j*10**(i+1))
print(snkue_number[:K])

Submission status: Wrong Answer

Solution code:
K=int(input())
snkue_number=[i for i in range(1,10)]
s=snkue_number[-1]
for j in range(1,9+1):
    snkue_number.append(s+j*10)
for i in range(1,10):
    s=snkue_number[-1]
    for j in range(i,(i-1)*10+9+1):
        snkue_number.append(s+j*10**(i+1))
print(snkue_number[:K])

Submission status: Wrong Answer

Solution code:
import sys
K = int(input())
count = 0
nine = ""

while 1:
    for i in range(9):
        print(str(i+1)+nine)
        count += 1
        if count == K:
            sys.exit()
    nine = nine + str(9)

Submission status: Wrong Answer

Solution code:
import sys

def dp(k):
  init = ['1']
  while len(init) < k:
    a = init[-1]
    if int(a[0]) < 9:
      init.append(str(int(a[0]) + 1) + a[1:])
    else:
      init.append('19' + a[1:])
  return init

  
def main():
  input = sys.stdin.readline
  K = int(input())
  print('\n'.join(dp(K)))


if __name__ == '__main__':
  main()

Submission status: Wrong Answer

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