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:

K = int(input())
aaa = 1
ans_array = []

def sunuke(n):
    re = 0
    tmp = n
    while n:
        re += n % 10
        n = n//10
    re = tmp/re
    print(re)

def print_sunuke():
    global aaa
    num = aaa % 10
    if num == 0:
        aaa += 1
        print_sunuke()
        return
    nine = aaa // 10
    ans = str(num) + "9" * nine
    aaa += 1
    ans_array.append(int(ans))




for i in range(10000):

    print_sunuke()

ans_array.append(1899)
ans_array.append(2899)
ans_array.append(3899)
ans_array.append(4899)
ans_array.append(5899)
ans_array.append(6899)
ans_array.append(7899)
ans_array.append(8899)
ans_array.append(9899)

ans_array.append(1799)
ans_array.append(2799)
ans_array.append(3799)
ans_array.append(4799)
ans_array.append(5799)
ans_array.append(6799)
ans_array.append(7799)
ans_array.append(8799)
ans_array.append(9799)

ans_array.append(1699)
ans_array.append(2699)
ans_array.append(3699)
ans_array.append(4699)
ans_array.append(5699)
ans_array.append(6699)
ans_array.append(7699)
ans_array.append(8699)
ans_array.append(9699)

ans_array.append(1599)
ans_array.append(2599)
ans_array.append(3599)
ans_array.append(4599)
ans_array.append(5599)
ans_array.append(6599)
ans_array.append(7599)
ans_array.append(8599)
ans_array.append(9599)

ans_array.append(1499)
ans_array.append(2499)
ans_array.append(3499)
ans_array.append(4499)
ans_array.append(5499)
ans_array.append(6499)
ans_array.append(7499)
ans_array.append(8499)
ans_array.append(9499)

ans_array.append(1399)
ans_array.append(2399)
ans_array.append(3399)
ans_array.append(4399)
ans_array.append(5399)
ans_array.append(6399)
ans_array.append(7399)
ans_array.append(8399)
ans_array.append(9399)

ans_array.append(1299)
ans_array.append(2299)
ans_array.append(3299)
ans_array.append(4299)
ans_array.append(5299)
ans_array.append(6299)
ans_array.append(7299)
ans_array.append(8299)
ans_array.append(9299)

ans_array.append(1199)
ans_array.append(2199)
ans_array.append(3199)
ans_array.append(4199)
ans_array.append(5199)
ans_array.append(6199)
ans_array.append(7199)
ans_array.append(8199)
ans_array.append(9199)

ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)
ans_array.append(189999)
ans_array.append(289999)
ans_array.append(389999)
ans_array.append(489999)
ans_array.append(589999)
ans_array.append(689999)
ans_array.append(789999)
ans_array.append(889999)
ans_array.append(989999)
ans_array.append(1899999)
ans_array.append(2899999)
ans_array.append(3899999)
ans_array.append(4899999)
ans_array.append(5899999)
ans_array.append(6899999)
ans_array.append(7899999)
ans_array.append(8899999)
ans_array.append(9899999)

ans_array.append(18999999)
ans_array.append(28999999)
ans_array.append(38999999)
ans_array.append(48999999)
ans_array.append(58999999)
ans_array.append(68999999)
ans_array.append(78999999)
ans_array.append(88999999)
ans_array.append(98999999)

ans_array.append(189999999)
ans_array.append(289999999)
ans_array.append(389999999)
ans_array.append(489999999)
ans_array.append(589999999)
ans_array.append(689999999)
ans_array.append(789999999)
ans_array.append(889999999)
ans_array.append(989999999)
ans_array.append(1899999999)
ans_array.append(2899999999)
ans_array.append(3899999999)
ans_array.append(4899999999)
ans_array.append(5899999999)
ans_array.append(6899999999)
ans_array.append(7899999999)
ans_array.append(8899999999)
ans_array.append(9899999999)



ans_array.sort()

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
c = [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]

c = c[:n]
for i in c:
 print i

Submission status: Wrong Answer

Solution code:
import sys
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]
L=set(L)
for i in range(10):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
for i in range(10,17):
    t=i-9
    for j in range(t*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
def main():
    maxi = 0
    k = int(input())
    for i in range(1, 10):
        k -= 1
        print(i)
        if not k:
            return
    for i in range(1000000000000000):
        for j in range(1, 10 * i):
            tmp = int(str(j) + str('9' * i))
            if maxi < tmp:
                maxi = tmp
            else:
                continue
            k -= 1
            print(tmp)
            if not k:
                return
        maxi = [int(i) for i in str(maxi)]
        index = 0
        for j in range(len(maxi)):
            if maxi[j] != 9:
                index = j
        maxi = int("".join(map(str, maxi)))

        for i in range(1, int(9 * index) * 10 + 1):
            tmp = int(str(i) + "" * len(str(maxi)))
            if tmp > maxi:
                maxi = tmp
                print(maxi)
        # while maxi[0] < 9:
        #     index = 0
        #     for j in range(len(maxi)):
        #         if maxi[j] != 9:
        #             index = j
        #     maxi[index] += 1
        #     k -= 1
        #
        #     print("".join(map(str, maxi)))
        #     if not k:
        #         return
        # maxi = int("".join(map(str, maxi)))
        # for j in range(i, 10):
        #     if i <= 1:
        #         break
        #     tmp = int(str(j) + str('9' * (2 * i - 1)))
        #     if maxi < tmp:
        #         maxi = tmp
        #     else:
        #         continue
        #     k -= 1
        #     print(tmp)


main()

Submission status: Wrong Answer

Solution code:
import sys
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]
L=set(L)
for i in range(10):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
for i in range(10,17):
    t=i-9
    for j in range(t*1000):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

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

def is_snuke(n, first_non9):
    n_copy = n
    s_n = 0
    for dig in range(0, 16):
        s_n += (n_copy % 10)
        n_copy //= 10
    return n * (s_n + 1) <= (n + 10**first_non9) * s_n


check = {}
for first_non9 in range(0, 16):
    base = (10**first_non9) - 1
    for top in range(1, 10**9):
        if k >= K:
            import sys
            sys.exit()
        n = top * (10 ** first_non9) + base
        if is_snuke(n, first_non9):
            k += 1
            if n not in check:
                print(n)
            check[n] = True
        else:
            break

Submission status: Wrong Answer

Solution code:
k = int(input())

sn_max = 1
div_max = 1
sn_t = 1
div_t = 1
cnt = 0
n = 0

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

n+=10

while cnt<k and n<100:
  n_str = list(str(n))
  sn_t = sum(list(map(int, n_str)))
  divn_t = n/sn_t

  m=n+10
  m_str = list(str(m))
  sm_t = sum(list(map(int, n_str)))
  divm_t = m/sm_t

  if divn_t <= divm_t:
    print(n)
    cnt += 1
  
  n=n+10

n=99

while cnt<k:
  n_str = list(str(n))
  sn_t = sum(list(map(int, n_str)))
  divn_t = n/sn_t

  m=n+100
  m_str = list(str(m))
  sm_t = sum(list(map(int, m_str)))
  divm_t = m/sm_t

  if divn_t <= divm_t:
    print(n)
    cnt += 1
  
  n=n+100

Submission status: Wrong Answer

Solution code:
# 2桁以上なら1足して繰り上がらないと駄目
# →絶対9が最後につく
# n = 10l + 9 なら1足して題意を満たす
k = int(input())
a = (k-1)//9 + 1
b = k%9
for i in range(a - 1):
    for j in range(9):
        print(str(j+1) + "9"*i)
for i in range(b):
    print(str(i+1) + "9"*(a-1))

Submission status: Wrong Answer

Solution code:
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 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, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999]
k = int(input())
try:
  for i in a[:k]:
    print(i)
except:
  for i in a:
    print(i)

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
if K < 10:
  for i in range(1, K + 1):
    print(i)
else:
  count = 0
  for i in range(1, 10):
    print(i)
  count += 9
  now = 9
  while(True):
    keta = int(math.log10(now)) + 1
    if now == 10**keta - 1:
      now = (10**keta) * 2 - 1
    else:
      now += 10**(keta - 1)
    count += 1
    print(now)
    if count > K:
      break

Submission status: Wrong Answer

Solution code:
K = int(input())
c = [9, 9, 19, 28, 37, 46, 55, 64, 73, 82, 91, 90, 90, 90, 90]
inc = 1
idx = 0
res = 0
for i in range(1, K+1):
	res += inc
	c[idx] -= 1
	if c[idx] == 0:
		idx += 1
		inc *= 10		
	print(res)

Submission status: Wrong Answer

Solution code:
N = int(input())
a =[1,2,3,4,5,6,7,8,9]
if N <= 9:
  for i in range(N):
    print(a[i])
else:
  for i in range(9):
    print(a[i])
  for i in range(N-9):
    print((i+1)*10 + 9)

Submission status: Wrong Answer

Solution code:
k = int(input())

sn_max = 1
div_max = 1
sn_t = 1
div_t = 1
cnt = 0
n = 0

for i in range(1, 10):
  print(i)
  n+=1
  cnt+=1

n+=10

while cnt<k and n<100:
  n_str = list(str(n))
  sn_t = sum(list(map(int, n_str)))
  divn_t = n/sn_t

  m=n+10
  m_str = list(str(m))
  sm_t = sum(list(map(int, n_str)))
  divm_t = m/sm_t

  if divn_t <= divm_t:
    print(n)
    cnt += 1
  
  n=n+10

n=99

while cnt<k:
  n_str = list(str(n))
  sn_t = sum(list(map(int, n_str)))
  divn_t = n/sn_t

  m=n+100
  m_str = list(str(m))
  sm_t = sum(list(map(int, m_str)))
  divm_t = m/sm_t

  if divn_t <= divm_t:
    print(n)
    cnt += 1
  
  n=n+100

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
if K < 10:
  for i in range(1, K + 1):
    print(i)
else:
  count = 0
  for i in range(1, 10):
    print(i)
  count += 9
  now = 9
  while(True):
    keta = int(math.log10(now)) + 1
    if now == 10**keta - 1:
      now = (10**keta) * 2 - 1
    else:
      now += 10**(keta - 1)
    count += 1
    print(now)
    print(count)
    if count >= K:
      break

Submission status: Wrong Answer

Solution code:
import sys
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]
L=set(L)
for i in range(10):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
for i in range(10,17):
    t=i-9
    for j in range(t*100):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
k=int(input())
 
cnt=0
while True:
    for i in range(15):
        if i<2:
            for j in range(1,10):
                print('{0}{1}'.format(j, '9'*i))
                cnt+=1
                if cnt==k:
                    exit()
        else:
            for j in range(i-2,10*(i-1)):
                print('{0}{1}'.format(j, '9'*(i-1)))
                cnt+=1
                if cnt==k:
                    exit()

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
if K < 10:
  for i in range(1, K + 1):
    print(i)
else:
  count = 0
  for i in range(1, 10):
    print(i)
  count += 9
  now = 9
  while(True):
    keta = int(math.log10(now)) + 1
    if now == 10**keta - 1:
      now = (10**keta) * 2 - 1
    else:
      now += 10**(keta - 1)
    count += 1
    print(now)
    print(count)
    if count > K:
      break

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
import bisect
import heapq
import math
import random
import sys
from collections import Counter, defaultdict
from decimal import ROUND_CEILING, ROUND_HALF_UP, Decimal
from functools import lru_cache, reduce
from itertools import combinations, combinations_with_replacement, product, permutations

sys.setrecursionlimit(10000)


def read_int():
    return int(input())


def read_int_n():
    return list(map(int, input().split()))


def read_float():
    return float(input())


def read_float_n():
    return list(map(float, input().split()))


def read_str():
    return input()


def read_str_n():
    return list(map(str, input().split()))


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


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

# @mt
def slv(K):

    i = 1
    ans = []
    for i in range(16):
        for j in range(1, 10):
            ans.append((10**i)*j + (10**(i)-1))

    return '\n'.join(map(str, ans[:K]))


def main():
    K = read_int()
    print(slv(K))

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
from sys import stdin, stdout

def f(v):
    return sum(map(int, list(str(v))))

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

for i in range(9):
    ans.append(ans[-1] + 10)

for i in range(19):
    ans.append(ans[-1] + 100)

cur = 28
add = 1000
while ans[-1] < 10 ** 15:
    for i in range(cur):
        ans.append(ans[-1] + add)
    
    add *= 10
    cur += 9

k = int(stdin.readline())
for i in range(k):
    stdout.write(str(ans[i]) + '\n')

Submission status: Wrong Answer

Solution code:
k = int(input())

count = 0
for i in range(1, 10, 1):
    count += 1
    print(i)
    if(count == k): exit()

for i in range(1, 20, 1):
    for j in range(1, 10, 1):
        if(i == 1 and j == 1): continue
        count += 1
        print((10**i) * j - 1)
        if(count == k): exit()

Submission status: Wrong Answer

Solution code:
k = int(input())
ans = 0
count = 0
for j in range(15):
    for i in range(9):
        ans += 1 * 10 ** j
        count += 1
        print(ans)
        if count == k:
            quit()

Submission status: Wrong Answer

Solution code:
K = int(input())
aaa = 1
ans_array = []

def sunuke(n):
    re = 0
    tmp = n
    while n:
        re += n % 10
        n = n//10
    re = tmp/re
    print(re)

def print_sunuke():
    global aaa
    num = aaa % 10
    if num == 0:
        aaa += 1
        print_sunuke()
        return
    nine = aaa // 10
    ans = str(num) + "9" * nine
    aaa += 1
    ans_array.append(int(ans))




for i in range(10000):

    print_sunuke()

ans_array.append(1899)
ans_array.append(2899)
ans_array.append(3899)
ans_array.append(4899)
ans_array.append(5899)
ans_array.append(6899)
ans_array.append(7899)
ans_array.append(8899)
ans_array.append(9899)
ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)
ans_array.append(189999)
ans_array.append(289999)
ans_array.append(389999)
ans_array.append(489999)
ans_array.append(589999)
ans_array.append(689999)
ans_array.append(789999)
ans_array.append(889999)
ans_array.append(989999)
ans_array.append(1899999)
ans_array.append(2899999)
ans_array.append(3899999)
ans_array.append(4899999)
ans_array.append(5899999)
ans_array.append(6899999)
ans_array.append(7899999)
ans_array.append(8899999)
ans_array.append(9899999)

ans_array.append(18999999)
ans_array.append(28999999)
ans_array.append(38999999)
ans_array.append(48999999)
ans_array.append(58999999)
ans_array.append(68999999)
ans_array.append(78999999)
ans_array.append(88999999)
ans_array.append(98999999)

ans_array.append(189999999)
ans_array.append(289999999)
ans_array.append(389999999)
ans_array.append(489999999)
ans_array.append(589999999)
ans_array.append(689999999)
ans_array.append(789999999)
ans_array.append(889999999)
ans_array.append(989999999)
ans_array.append(1899999999)
ans_array.append(2899999999)
ans_array.append(3899999999)
ans_array.append(4899999999)
ans_array.append(5899999999)
ans_array.append(6899999999)
ans_array.append(7899999999)
ans_array.append(8899999999)
ans_array.append(9899999999)



ans_array.sort()

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

Submission status: Wrong Answer

Solution code:

K = int(input())
aaa = 1
ans_array = []

def sunuke(n):
    re = 0
    tmp = n
    while n:
        re += n % 10
        n = n//10
    re = tmp/re
    print(re)

def print_sunuke():
    global aaa
    num = aaa % 10
    if num == 0:
        aaa += 1
        print_sunuke()
        return
    nine = aaa // 10
    ans = str(num) + "9" * nine
    aaa += 1
    ans_array.append(int(ans))




for i in range(10000):

    print_sunuke()

ans_array.append(1899)
ans_array.append(2899)
ans_array.append(3899)
ans_array.append(4899)
ans_array.append(5899)
ans_array.append(6899)
ans_array.append(7899)
ans_array.append(8899)
ans_array.append(9899)
ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)
ans_array.append(189999)
ans_array.append(289999)
ans_array.append(389999)
ans_array.append(489999)
ans_array.append(589999)
ans_array.append(689999)
ans_array.append(789999)
ans_array.append(889999)
ans_array.append(989999)
ans_array.append(1899999)
ans_array.append(2899999)
ans_array.append(3899999)
ans_array.append(4899999)
ans_array.append(5899999)
ans_array.append(6899999)
ans_array.append(7899999)
ans_array.append(8899999)
ans_array.append(9899999)

ans_array.append(18999999)
ans_array.append(28999999)
ans_array.append(38999999)
ans_array.append(48999999)
ans_array.append(58999999)
ans_array.append(68999999)
ans_array.append(78999999)
ans_array.append(88999999)
ans_array.append(98999999)

ans_array.append(189999999)
ans_array.append(289999999)
ans_array.append(389999999)
ans_array.append(489999999)
ans_array.append(589999999)
ans_array.append(689999999)
ans_array.append(789999999)
ans_array.append(889999999)
ans_array.append(989999999)
ans_array.append(1899999999)
ans_array.append(2899999999)
ans_array.append(3899999999)
ans_array.append(4899999999)
ans_array.append(5899999999)
ans_array.append(6899999999)
ans_array.append(7899999999)
ans_array.append(8899999999)
ans_array.append(9899999999)



ans_array.sort()

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

Submission status: Wrong Answer

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

def snk(n):
    return n/dig(n)
d = {}

for i in range(1,10):
    d[i] = i
    d[i+9] = 10*i+9
    d[i+18] = 100*i+99

l = []
for i in range(len(d)):
    l.append(d[i+1])

for j in range(3,16):
    q = 10**(j-1)-1
    for i in range(10,100):
        if snk(i*10**(j-1)+q) <= snk(i//10*10**j+10*q+9):
            l.append(i*10**(j-1)+q)

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

Submission status: Wrong Answer

Solution code:
k = int(input())
a = 0
b = 0
for i in range(k):
    a += 1
    if(a == 10):
        a = 1
        b += 1
    print(a, end="")
    if(b >= 2):
        print('9' * (b - 1), end="")
    if(b >= 1):
        print('9', end="")
    print()

Submission status: Wrong Answer

Solution code:
N = int(input())
a =[1,2,3,4,5,6,7,8,9]
for i in range(2,1000000):
  a.append(10*i -1)
for i in range(N):
  print(a[i])

Submission status: Wrong Answer

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

a = []

K = int(input())

l = 0
cnt = 0
while cnt<K*50:
	for i in range(1,K+1):
		x = int(str(i)+'9'*l)
		y = int(str(i+1)+'9'*l)
		if x*s(y) > y*s(x):
			break
		a.append(x)
		cnt += 1
	l += 1
	
ans = sorted(a)[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
k = int(input())
a = 0
b = 0
for i in range(k):
    a += 1
    if(a == 10):
        a = 1
        b += 1
    print(a, end="")
    if(b >= 2):
        print('0' * (b - 1), end="")
    if(b >= 1):
        print('9', end="")
    print()

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python3
import sys
def debug(*args): print(*args, file=sys.stderr)
def exit(): sys.exit(0)


K = int(input())

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


def is_snuke(e, a):
    n = a*(10**e) + (10**e-1)
    nS = n / S(n)
    for i in range(1, 200):
        m = n + i * (10**e)
        if nS > m / S(m):
            return False
    return True


e = 0
a = 1
while K > 0:
    n = a*(10**e) + (10**e-1)
    if n >= 10**(e+1):
        e = e+1
        a = 1
        continue
    if is_snuke(e, a):
        print(n)
        K -= 1
        a += 1

Submission status: Wrong Answer

Solution code:
def main():
    maxi = 0
    k = int(input())
    for i in range(1000000000000000):
        for j in range(1, 10 * i):
            tmp = int(str(j) + str('9' * i))
            if maxi < tmp:
                maxi = tmp
            else:
                continue
            k -= 1
            print(tmp)
            if not k:
                return
        maxi = [int(i) for i in str(maxi)]
        while maxi[0] < 9:
            index = 0
            for j in range(len(maxi)):
                if maxi[j] != 9:
                    index = j
            maxi[index] += 1
            k -= 1

            print("".join(map(str, maxi)))
            if not k:
                return
        maxi = int("".join(map(str, maxi)))
        # for j in range(i, 10):
        #     if i <= 1:
        #         break
        #     tmp = int(str(j) + str('9' * (2 * i - 1)))
        #     if maxi < tmp:
        #         maxi = tmp
        #     else:
        #         continue
        #     k -= 1
        #     print(tmp)


main()

Submission status: Wrong Answer

Solution code:
k = int(input())
arr = []
for i in range(1, 100):
	for j in range(1, 100):
		arr.append(str(j)+'9'*(i-1))
for i in arr[:k]:
  print(int(i))

Submission status: Wrong Answer

Solution code:
k = int(input())
x = [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]
for i in x[:k]: print(i)

Submission status: Wrong Answer

Solution code:
import math
K = int(input())
if K < 9:
  for i in range(1, K + 1):
    print(i)
else:
  count = 0
  for i in range(1, 10):
    print(i)
  count += 9
  now = 9
  while(True):
    keta = int(math.log10(now)) + 1
    if now == 10**keta - 1:
      now = (10**keta) * 2 - 1
    else:
      now += 10**(keta - 1)
    count += 1
    print(now)
    if count >= K:
      break

Submission status: Wrong Answer

Solution code:
import sys
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]
L=set(L)
for i in range(18):
    for j in range(1,i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:
def main():
    maxi = 0
    k = int(input())
    for i in range(30):
        for j in range(1, 10 * i):
            tmp = int(str(j) + str('9' * i))
            if maxi < tmp:
                maxi = tmp
            else:
                continue
            k -= 1
            print(tmp)
            if not k:
                return
        maxi = [int(i) for i in str(maxi)]
        while maxi[0] < 9:
            index = 0
            for j in range(len(maxi)):
                if maxi[j] != 9:
                    index = j
            maxi[index] += 1
            k -= 1

            print("".join(map(str, maxi)))
            if not k:
                return
        maxi = int("".join(map(str, maxi)))
        # for j in range(i, 10):
        #     if i <= 1:
        #         break
        #     tmp = int(str(j) + str('9' * (2 * i - 1)))
        #     if maxi < tmp:
        #         maxi = tmp
        #     else:
        #         continue
        #     k -= 1
        #     print(tmp)


main()

Submission status: Wrong Answer

Solution code:
k = int(input())
arr = []
for i in range(1, 100):
	for j in range(1, 100):
		arr.append(str(j)+'9'*(i-1))
for i in arr[:k]:
  print(i)

Submission status: Wrong Answer

Solution code:
# encoding:utf-8
def main(k):
	digit = 1
	cnt = 0
	cur = 0

	for i in range(1, 10):
		print(i)
		cnt += 1
		if cnt == k:
			return

	while True:
		header = 0
		while True:
			header += 1
			if header >= digit * 10:
				break
			
			ans = int(str(header)+ "9" * digit)
			if ans <= cur:
				continue
			else:
				print(ans)	
				cur = ans	
				cnt += 1
				if cnt == k:
					return

		digit += 1


	


if __name__ == '__main__':
	k = int(input())
	main(k)

Submission status: Wrong Answer

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

a = []

K = int(input())

l = 0
cnt = 0
while cnt<K*20:
	for i in range(1,K+1):
		x = int(str(i)+'9'*l)
		y = int(str(i+1)+'9'*l)
		if x*s(y) > y*s(x):
			break
		a.append(x)
		cnt += 1
	l += 1
	
ans = sorted(a)[:K]
print('\n'.join(map(str,ans)))

Submission status: Wrong Answer

Solution code:

K = int(input())
aaa = 1
ans_array = []

def sunuke(n):
    re = 0
    tmp = n
    while n:
        re += n % 10
        n = n//10
    re = tmp/re
    print(re)

def print_sunuke():
    global aaa
    num = aaa % 10
    if num == 0:
        aaa += 1
        print_sunuke()
        return
    nine = aaa // 10
    ans = str(num) + "9" * nine
    aaa += 1
    ans_array.append(int(ans))




for i in range(10000):

    print_sunuke()

ans_array.append(1899)
ans_array.append(2899)
ans_array.append(3899)
ans_array.append(4899)
ans_array.append(5899)
ans_array.append(6899)
ans_array.append(7899)
ans_array.append(8899)
ans_array.append(9899)
ans_array.append(18999)
ans_array.append(28999)
ans_array.append(38999)
ans_array.append(48999)
ans_array.append(58999)
ans_array.append(68999)
ans_array.append(78999)
ans_array.append(88999)
ans_array.append(98999)
ans_array.append(189999)
ans_array.append(289999)
ans_array.append(389999)
ans_array.append(489999)
ans_array.append(589999)
ans_array.append(689999)
ans_array.append(789999)
ans_array.append(889999)
ans_array.append(989999)
ans_array.append(1899999)
ans_array.append(2899999)
ans_array.append(3899999)
ans_array.append(4899999)
ans_array.append(5899999)
ans_array.append(6899999)
ans_array.append(7899999)
ans_array.append(8899999)
ans_array.append(9899999)
ans_array.append(1899899)
ans_array.append(2899899)
ans_array.append(3899899)
ans_array.append(4899899)
ans_array.append(5899899)
ans_array.append(6899899)
ans_array.append(7899899)
ans_array.append(8899899)
ans_array.append(9899899)


ans_array.sort()

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

Submission status: Wrong Answer

Solution code:
from sys import stdin
n = int(stdin.readline())
c = [1,2,3,4,5,6,7,8,9]
i = 0
while len(c) < n:
 c.append( c[i] * 10 + 9)
 i += 1
c = c[:n]
for i in c:
 print i

Submission status: Wrong Answer

Solution code:
import sys
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]
L=set(L)
for i in range(18):
    for j in range(i*10):
        L.add(pow(10,i) * j + pow(10,i)-1)
L=list(L)
L.sort()
ans=L[:K]
print('\n'.join(map(str,ans)))