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: Runtime Error

Solution code:
k = int(input())
l =  [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999,1099,1199,1299,1399,1499,1599,1699,1799,1899,1999,2999,3999,4999,5999,6999,7999,8999,9999,10999,11999,12999,13999,14999,15999,16999,17999,18999,19999,20999,21999,22999,23999,24999,25999,26999,27999,28999,29999,39999,49999,59999,69999,79999,89999,99999,109999,119999,129999,139999,149999,159999,169999,179999,189999,199999,209999,219999,229999,239999,249999,259999,269999,279999,289999,299999,309999,319999,329999,339999,349999,359999,369999,379999,389999,399999,499999,599999,699999,799999,899999,999999,1099999,1199999,1299999,1399999,1499999,1599999,1699999,1799999,1899999,1999999,2099999,2199999,2299999,2399999,2499999,2599999,2699999,2799999,2899999,2999999,3099999,3199999,3299999,3399999,3499999,3599999,3699999,3799999,3899999,3999999,4099999,4199999,4299999,4399999,4499999,4599999,4699999,4799999,4899999,4999999,5999999,6999999,7999999,8999999,9999999,10999999,11999999,12999999,13999999,14999999,15999999,16999999,17999999,18999999,19999999,20999999,21999999,22999999,23999999,24999999,25999999,26999999,27999999,28999999,29999999,30999999,31999999,32999999,33999999,34999999,35999999,36999999,37999999,38999999,39999999,40999999,41999999,42999999,43999999,44999999,45999999,46999999,47999999,48999999,49999999,50999999,51999999,52999999,53999999,54999999,55999999,56999999,57999999,58999999,59999999,69999999,79999999,89999999,99999999,109999999,119999999,129999999,139999999,149999999,159999999,169999999,179999999,189999999,199999999,209999999,219999999,229999999,239999999,249999999,259999999,269999999,279999999,289999999,299999999,309999999,319999999,329999999,339999999,349999999,359999999,369999999,379999999,389999999,399999999,409999999,419999999,429999999,439999999,449999999,459999999,469999999,479999999,489999999,499999999,509999999,519999999,529999999,539999999,549999999,559999999,569999999,579999999,589999999,599999999,609999999,619999999,629999999,639999999,649999999,659999999,669999999,679999999,689999999,699999999,799999999,899999999,999999999,1099999999,1199999999,1299999999,1399999999,1499999999,1599999999,1699999999,1799999999,1899999999,1999999999,2099999999,2199999999,2299999999,2399999999,2499999999,2599999999,2699999999,2799999999,2899999999,2999999999,3099999999,3199999999,3299999999,3399999999,3499999999,3599999999,3699999999,3799999999,3899999999,3999999999,4099999999,4199999999,4299999999,4399999999,4499999999,4599999999,4699999999,4799999999,4899999999,4999999999,5099999999,5199999999,5299999999,5399999999,5499999999,5599999999,5699999999,5799999999,5899999999,5999999999,6099999999,6199999999,6299999999,6399999999,6499999999,6599999999,6699999999,6799999999,6899999999,6999999999,7099999999,7199999999,7299999999,7399999999,7499999999,7599999999,7699999999,7799999999,7899999999,7999999999,8999999999,9999999999,10999999999,11999999999,12999999999,13999999999,14999999999,15999999999,16999999999,17999999999,18999999999,19999999999,20999999999,21999999999,22999999999,23999999999,24999999999,25999999999,26999999999,27999999999,28999999999,29999999999,30999999999,31999999999,32999999999,33999999999,34999999999,35999999999,36999999999,37999999999,38999999999,39999999999,40999999999,41999999999,42999999999,43999999999,44999999999,45999999999,46999999999,47999999999,48999999999,49999999999,50999999999,51999999999,52999999999,53999999999,54999999999,55999999999,56999999999,57999999999,58999999999,59999999999,60999999999,61999999999,62999999999,63999999999,64999999999,65999999999,66999999999,67999999999,68999999999,69999999999,70999999999,71999999999,72999999999,73999999999,74999999999,75999999999,76999999999,77999999999,78999999999,79999999999,80999999999,81999999999,82999999999,83999999999,84999999999,85999999999,86999999999,87999999999,88999999999,89999999999,99999999999,109999999999,119999999999,129999999999,139999999999,149999999999,159999999999,169999999999,179999999999,189999999999,199999999999,209999999999,219999999999,229999999999,239999999999,249999999999,259999999999,269999999999,279999999999,289999999999,299999999999,309999999999,319999999999,329999999999,339999999999,349999999999,359999999999,369999999999,379999999999,389999999999,399999999999,409999999999,419999999999,429999999999,439999999999,449999999999,459999999999,469999999999,479999999999,489999999999,499999999999,509999999999,519999999999,529999999999,539999999999,549999999999,559999999999,569999999999,579999999999,589999999999,599999999999,609999999999,619999999999,629999999999,639999999999,649999999999,659999999999,669999999999,679999999999,689999999999,699999999999,709999999999,719999999999,729999999999,739999999999,749999999999,759999999999,769999999999,779999999999,789999999999,799999999999,809999999999,819999999999,829999999999,839999999999,849999999999,859999999999,869999999999,879999999999,889999999999,899999999999,909999999999,919999999999,929999999999,939999999999,949999999999,959999999999,969999999999,979999999999,999999999999,989999999999]
for i in range(k):
    print(l[i])

Submission status: Runtime Error

Solution code:
K=int(input())
a=[]
for j in range(1,17):
    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: Runtime Error

Solution code:
ans = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999]
for i in range(int(input())):
    print(ans[i])

Submission status: Runtime Error

Solution code:
K=int(input())
a=[]
for j in range(1,17):
    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: Runtime Error

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

Submission status: Runtime Error

Solution code:
K = int(input())

if K < 10:
    num_list = [i for i in range(1, K+1)]
    print(*num_list, sep='\n')
else:
    num_list = [i for i in range(1, 10)]
    n = 19
    digits = 2
    while len(num_list) < K:
        num_list.append(n)
        if str(n+1)[0] > 3:
            digits += 1
        n += 10**(digits - 1)
    print(*num_list, sep='\n')

Submission status: Runtime Error

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

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

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

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

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


if __name__ == '__main__':
    k = int(input())
    ans = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999, 19999999999999999, 29999999999999999, 39999999999999999, 49999999999999999, 59999999999999999, 69999999999999999, 79999999999999999, 89999999999999999, 99999999999999999]

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

Submission status: Runtime Error

Solution code:
K = int(input())
for i in range(1,100):
    for k in range(i,i * 10):
        b.append(10**(i+1) *k + kyuu(i+1))
        if len(b) == K:
            break
for bb in b:
    print(bb)

Submission status: Runtime Error

Solution code:
k = int(input())
l =[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999,1099,1199,1299,1399,1499,1599,1699,1799,1899,1999,2999,3999,4999,5999,6999,7999,8999,9999,10999,11999,12999,13999,14999,15999,16999,17999,18999,19999,20999,21999,22999,23999,24999,25999,26999,27999,28999,29999,39999,49999,59999,69999,79999,89999,99999,109999,119999,129999,139999,149999,159999,169999,179999,189999,199999,209999,219999,229999,239999,249999,259999,269999,279999,289999,299999,309999,319999,329999,339999,349999,359999,369999,379999,389999,399999,499999,599999,699999,799999,899999,999999,1099999,1199999,1299999,1399999,1499999,1599999,1699999,1799999,1899999,1999999,2099999,2199999,2299999,2399999,2499999,2599999,2699999,2799999,2899999,2999999,3099999,3199999,3299999,3399999,3499999,3599999,3699999,3799999,3899999,3999999,4099999,4199999,4299999,4399999,4499999,4599999,4699999,4799999,4899999,4999999,5999999,6999999,7999999,8999999,9999999,10999999,11999999,12999999,13999999,14999999,15999999,16999999,17999999,18999999,19999999,20999999,21999999,22999999,23999999,24999999,25999999,26999999,27999999,28999999,29999999,30999999,31999999,32999999,33999999,34999999,35999999,36999999,37999999,38999999,39999999,40999999,41999999,42999999,43999999,44999999,45999999,46999999,47999999,48999999,49999999,50999999,51999999,52999999,53999999,54999999,55999999,56999999,57999999,58999999,59999999,69999999,79999999,89999999,99999999,109999999,119999999,129999999,139999999,149999999,159999999,169999999,179999999,189999999,199999999,209999999,219999999,229999999,239999999,249999999,259999999,269999999,279999999,289999999,299999999,309999999,319999999,329999999,339999999,349999999,359999999,369999999,379999999,389999999,399999999,409999999,419999999,429999999,439999999,449999999,459999999,469999999,479999999,489999999,499999999,509999999,519999999,529999999,539999999,549999999,559999999,569999999,579999999,589999999,599999999,609999999,619999999,629999999,639999999,649999999,659999999,669999999,679999999,689999999,699999999,799999999,899999999,999999999]
for i in range(k):
    print(l[i])

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())
    
    snuke_nums = []
    for i in range(15):
        snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])
        if len(snuke_nums) >= k:
            break
    
    num = len(snuke_nums)
    snuke_sn = [0 for _ in range(num)]
    for i in range(num):
        tmp = snuke_nums[i]
        sn = 0
        while tmp:
            sn += tmp % 10
            tmp //= 10
        snuke_sn[i] = snuke_nums[i] / sn
    
    snuke_sn_sort = sorted(snuke_sn)
    
    snuke_flag = [False for _ in range(num)]
    for i in range(num):
        if snuke_sn[i] != snuke_sn_sort[i]:
            snuke_flag[i] = True
    
    snuke_ans = []
    for i in range(num):
        if not snuke_flag[i]:
            snuke_ans.append(snuke_nums[i])
    
    for i in range(k):
        print(snuke_ans[i])


abc101_d()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
ans = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999]
for i in range(int(input())):
    print(ans[i])

Submission status: Runtime Error

Solution code:
k = int(input())

snuke_nums = []
for i in range(15):
    snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])

num = len(snuke_nums)
snuke_sn = [0 for _ in range(num)]
for i in range(num):
    tmp = snuke_nums[i]
    sn = 0
    while tmp:
        sn += tmp % 10
        tmp //= 10
    snuke_sn[i] = snuke_nums[i] / sn

snuke_sn_sort = sorted(snuke_sn)

snuke_flag = [False for _ in range(num)]
for i in range(num):
    if snuke_sn[i] != snuke_sn_sort[i]:
        snuke_flag[i] = True

snuke_ans = []
for i in range(num):
    if not snuke_flag[i]:
        snuke_ans.append(snuke_nums[i])

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

Submission status: Runtime Error

Solution code:
list_9 = [1,
 2,
 3,
 4,
 5,
 6,
 7,
 8,
 9,
 19,
 29,
 39,
 49,
 59,
 69,
 79,
 89,
 99,
 199,
 299,
 399,
 499,
 599,
 699,
 799,
 899,
 999,
 1099,
 1199,
 1299,
 1399,
 1499,
 1599,
 1699,
 1799,
 1899,
 1999,
 2999,
 3999,
 4999,
 5999,
 6999,
 7999,
 8999,
 9999,
 10999,
 11999,
 12999,
 13999,
 14999,
 15999,
 16999,
 17999,
 18999,
 19999,
 29999,
 39999,
 49999,
 59999,
 69999,
 79999,
 89999,
 99999,
 109999,
 119999,
 129999,
 139999,
 149999,
 159999,
 169999,
 179999,
 189999,
 199999,
 299999,
 399999,
 499999,
 599999,
 699999,
 799999,
 899999,
 999999,
 1099999,
 1199999,
 1299999,
 1399999,
 1499999,
 1599999,
 1699999,
 1799999,
 1899999,
 1999999,
 2999999,
 3999999,
 4999999,
 5999999,
 6999999,
 7999999,
 8999999,
 9999999,
 10999999,
 11999999,
 12999999,
 13999999,
 14999999,
 15999999,
 16999999,
 17999999,
 18999999,
 19999999,
 29999999,
 39999999,
 49999999,
 59999999,
 69999999,
 79999999,
 89999999,
 99999999,
 109999999,
 119999999,
 129999999,
 139999999,
 149999999,
 159999999,
 169999999,
 179999999,
 189999999,
 199999999,
 299999999,
 399999999,
 499999999,
 599999999,
 699999999,
 799999999,
 899999999,
 999999999,
 1099999999,
 1199999999,
 1299999999,
 1399999999,
 1499999999,
 1599999999,
 1699999999,
 1799999999,
 1899999999,
 1999999999,
 2999999999,
 3999999999,
 4999999999,
 5999999999,
 6999999999,
 7999999999,
 8999999999,
 9999999999,
 10999999999,
 11999999999,
 12999999999,
 13999999999,
 14999999999,
 15999999999,
 16999999999,
 17999999999,
 18999999999,
 19999999999,
 29999999999,
 39999999999,
 49999999999,
 59999999999,
 69999999999,
 79999999999,
 89999999999,
 99999999999,
 109999999999,
 119999999999,
 129999999999,
 139999999999,
 149999999999,
 159999999999,
 169999999999,
 179999999999,
 189999999999,
 199999999999,
 299999999999,
 399999999999,
 499999999999,
 599999999999,
 699999999999,
 799999999999,
 899999999999,
 999999999999,
 1099999999999,
 1199999999999,
 1299999999999,
 1399999999999,
 1499999999999,
 1599999999999,
 1699999999999,
 1799999999999,
 1899999999999,
 1999999999999,
 2999999999999,
 3999999999999,
 4999999999999,
 5999999999999,
 6999999999999,
 7999999999999,
 8999999999999,
 9999999999999,
 10999999999999,
 11999999999999,
 12999999999999,
 13999999999999,
 14999999999999,
 15999999999999,
 16999999999999,
 17999999999999,
 18999999999999,
 19999999999999,
 29999999999999,
 39999999999999,
 49999999999999,
 59999999999999,
 69999999999999,
 79999999999999,
 89999999999999,
 99999999999999,
 109999999999999,
 119999999999999,
 129999999999999,
 139999999999999,
 149999999999999,
 159999999999999,
 169999999999999,
 179999999999999,
 189999999999999,
 199999999999999,
 299999999999999,
 399999999999999,
 499999999999999,
 599999999999999,
 699999999999999,
 799999999999999,
 899999999999999,
 1099999999999999,
 1199999999999999,
 1299999999999999,
 1399999999999999,
 1499999999999999,
 1599999999999999,
 1699999999999999,
 1799999999999999,
 1899999999999999]

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

Submission status: Runtime Error

Solution code:
ans = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999]
for i in int(input()):
    print(ans(i))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


if __name__ == '__main__':
    k = int(input())
    ans = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
list_9 = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89]
for gcounter in range(2,20):
    for i in range(1,10):
        a = i*10**gcounter-1
        list_9.append(a)
    for i in range(1,10):
        a = i*10**gcounter-1+10**(gcounter+1)
        list_9.append(a)
list_9.sort()

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

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())

    snuke_nums = []
    for i in range(16):
        snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])

    num = len(snuke_nums)
    snuke_sn = [0 for _ in range(num)]
    for i in range(num):
        tmp = snuke_nums[i]
        sn = 0
        while tmp:
            sn += tmp % 10
            tmp //= 10
        snuke_sn[i] = snuke_nums[i] / sn

    snuke_sn_sort = sorted(snuke_sn)

    snuke_flag = [False for _ in range(num)]
    for i in range(num):
        if snuke_sn[i] != snuke_sn_sort[i]:
            snuke_flag[i] = True

    snuke_ans = []
    for i in range(num):
        if not snuke_flag[i]:
            snuke_ans.append(snuke_nums[i])

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


abc101_d()

Submission status: Runtime Error

Solution code:
k = int(input())
a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,100,110,200,210,300,310,400,410,500,510,600,610,700]
n = 0
while n < k:
    print(a[n])
    n += 1

Submission status: Runtime Error

Solution code:
list_9 = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89]
for gcounter in range(2,15):
    for i in range(1,10):
        a = i*10**gcounter-1
        list_9.append(a)
    for i in range(1,10):
        a = i*10**gcounter-1+10**(gcounter+1)
        list_9.append(a)
list_9.sort()

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

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())

    snuke_nums = []
    for i in range(15):
        snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])

    num = len(snuke_nums)
    snuke_sn = [0 for _ in range(num)]
    for i in range(num):
        tmp = snuke_nums[i]
        sn = 0
        while tmp:
            sn += tmp % 10
            tmp //= 10
        snuke_sn[i] = snuke_nums[i] / sn

    snuke_sn_sort = sorted(snuke_sn)

    snuke_flag = [False for _ in range(num)]
    for i in range(num):
        if snuke_sn[i] != snuke_sn_sort[i]:
            snuke_flag[i] = True

    snuke_ans = []
    for i in range(num):
        if not snuke_flag[i]:
            snuke_ans.append(snuke_nums[i])

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


abc101_d()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
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: Runtime Error

Solution code:
K = int(input())
L = list(range(1, 10))
for i in range(1, 16):
    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: Runtime Error

Solution code:
k = int(input())
i = 0
n = 1
while True:
    if i == k:
        break
    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: Runtime Error

Solution code:
def d_snuke_numbers(K):
    candidate = []
    for k in range(20):
        for l in range(1, 10):
            candidate.append(str(l)+str(9)*k)
    ans = []
    for k in range(K):
        ans.append(candidate[k])
    ans = '\n'.join(ans)
    return ans

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

Submission status: Runtime Error

Solution code:
k = int(input())
i = 0
n = 1
while True:
    if n == k:
        break
    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):
        print(n)
    
    n += 1

Submission status: Runtime Error

Solution code:
K=int(input())
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: Runtime Error

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

k_input = int(input())

ans_list = [1, 2, 3, 4, 5, 6, 7, 8, 9]
num = '9'

while int(num) <= 10**20:
    for head in range(1, 10):
        ans_list.append(int(str(head) + num))
    num += '9'

for ans_index in range(k_input):
    print(ans_list[ans_index])

Submission status: Runtime Error

Solution code:
def d_snuke_numbers(K):
    candidate = []
    for k in range(16):
        for l in range(1, 10):
            candidate.append(str(l)+str(9)*k)
    ans = []
    for k in range(K):
        ans.append(candidate[k])
    ans = '\n'.join(ans)
    return ans

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

Submission status: Runtime Error

Solution code:
def d_snuke_numbers(K):
    candidate = []
    for k in range(15):
        for l in range(1, 10):
            candidate.append(str(l)+str(9)*k)
    ans = []
    for k in range(K):
        ans.append(candidate[k])
    ans = '\n'.join(ans)
    return ans

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

Submission status: Runtime Error

Solution code:
K = int(input())
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: Runtime Error

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