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

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

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

# print(seeds)

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

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

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

print(ans[k-1])

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

Submission status: Wrong Answer

Solution code:
# your code goes here
K = int(input())

for i in range(9):
	print(i+1)

ans_num = 9
i = 1
while ans_num < K:
	ans = 10*i+9
	ans_s = str(ans)
	flag = True
	for j in range(1,len(ans_s)-1):
		if ans_s[j] == '0':
			flag = False
			break
	if flag:
		print(ans)
		ans_num += 1
	i += 1

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
def digit_sum(i):
	list_i = [int(x) for x in str(i)]
	return sum(list_i)

K = int(input())
Sn = []
for i in range(2, pow(10, 15) + 1):
	if (i - 1) / digit_sum(i-1) <= (i / digit_sum(i)):
		Sn.append(i - 1)
	if len(Sn) == K:
		break
for i in range(len(Sn)):
	print(Sn[i])

Submission status: Wrong Answer

Solution code:
# coding=utf-8

K = int(input())

block = K // 9
rest = K % 9

if block == 0:
    for i in range(1, rest+1):
        print(i)
else:
    memo = 0
    for j in range(block+1):
        if j == block:
            for h in range(1, rest+1):
                print(memo + h*10**j)
            break
        for k in range(1, 10):
            print(memo + k*10**j)
        memo += 9*10**j

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

l =[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99]
for i in range(K):
    l.append(199+i*100)

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

Submission status: Wrong Answer

Solution code:
k = int(input())
if k < 10:
    for i in range(1, k + 1):
        print(i)
else:
    for i in range(1, 10):
        print(i)
    ge = "1"
    do = "9"
    for i in range(k - 9):
        if i % 2 == 0:
            ge += "9"
            print(ge)
        else:
            do += "0"
            print(do)

Submission status: Wrong Answer

Solution code:
k=int(input())
nine=0
first=1
for _ in [0]*k:
    print(str(first)+"9"*nine)
    first+=1
    if first==10:
        first=1
        nine+=1

Submission status: Wrong Answer

Solution code:
MAX = 10**15+1

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

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

def main():
    K = int(input())
    gen = get_snuke()
    
    for _ in range(K):
        snuke_num = gen.__next__()
        print(snuke_num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
k = int(input())

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

count_k = 0
for i in range(1,10**15+1):
    if sunuke(i) <= sunuke(i+1):
        count_k += 1
        print(i)
        if count_k == k:
            break

Submission status: Wrong Answer

Solution code:
k = int(input())
keta = k // 9
upper = k % 9
if keta > 0:
    for i in range(keta):
        for hoge in range(1,10):
            print((hoge+1) *10**i -1)
if upper > 0:
    for hoge in range(1,upper+1):
        print((hoge+1) *10**keta -1)

Submission status: Wrong Answer

Solution code:
N=int(input())
if N <10:
    for i in range (N):
        print (i+1)
else:
    for i in range (9):
         print (i+1)
    count=1
    for j in range (N-9):
        if j ==0:
            print (19)
        elif j ==1:
            print(199)
        else:
            print( int(str(1)+str(0)*count+str(99)))
            count+=1

Submission status: Wrong Answer

Solution code:
K_s = input()
sum = 0
for letter in K_s:
    sum = sum + int(letter)
K = int(K_s)
for n in range(1, K//sum):
    print(n)
count = K//sum-1
if K%sum !=0:
    print(n+1)
    count = count +1
for i in range(2, K//(K//sum)+2):
    if count == K:
        break
    for j in reversed(range(sum*i)):
        if count == K:
            break
        print(K*i-j)
        count = count + 1

Submission status: Wrong Answer

Solution code:
K = int(input())
count = 0
for i in range(1000000000000000000000000000000000000000000000000000000000000):
    if(count == K):
        break
    num = 0
    try:
        tmp = str(i)
        for j in tmp:
            num += int(j)
        # print("n:{},  s:{}, ans ={}".format(i,num,int(i) / num))
        if(i != 0 and i < 10 or tmp[-1:] == "9"):
            print(i)
            count += 1
    except:
        print("zero")

Submission status: Wrong Answer

Solution code:
# coding=utf-8

K = int(input())

block = K // 9
rest = K % 9

if block == 0:
    for i in range(rest):
        print(i)

memo = 0
for j in range(block+1):
    if j == block:
        for h in range(1, rest+1):
            print(memo + h*10**j)
        break
    for k in range(1, 10):
        print(memo + k*10**j)
    memo += 9*10**j

Submission status: Wrong Answer

Solution code:
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 + 40):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

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

Submission status: Wrong Answer

Solution code:
MAX = 10**15+1

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

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

def main():
    K = 100
    gen = get_snuke()
    
    for _ in range(K):
        snuke_num = gen.__next__()
        print(snuke_num)

if __name__ == "__main__":
    main()

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

k =int(input())


for i in range(1,k+1):
    j = (i-1) // 9
    k = i - 9 * j
    p = k 
    print(k, end="")
    for ii in range(j):
        print('9', end="")
    print("")

Submission status: Wrong Answer

Solution code:
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 + 30):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

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

Submission status: Wrong Answer

Solution code:
K = int(input())

loop = 0

while(K >= 9):
  for i in range(2,11):
  	print((10**loop)*i-1)
  loop += 1
  K -= 9

j = 2
while(K > 0):
  print((10**loop)*j-1)
  K -= 1
  j += 1

Submission status: Wrong Answer

Solution code:
k=int(input())
def number(x):
    if x%9==0:
        a=''
    else:
        a=str(x%9)
    b='9'*(x//9)
    y=a+b
    return y
for i in range(k):
    print(number(i+1))

Submission status: Wrong Answer

Solution code:
k = int(input())

old = 0
now = 0
num = 0
Sn = 1
co = 0
def calc(n):
    n = str(n)
    now = 0

    for i in range(len(n)):
        now = now + int(n[i])

    return now

while co < k:
    num = num + 1
    old = now
    now = num
    So = Sn
    Sn = now/calc(now)
    if So <= Sn and old != 0:
        print(old)
        co = co + 1

Submission status: Wrong Answer

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

K=int(input())

count=0
n=0
zouka=1
kakunin=-1
while count<K:
    n+=zouka
    if str(n)[0:1]=="9":
        zouka=zouka*10
    print(n)
    
    count+=1

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k):
    print(i)
if k >= 10:
    for i in range(10,k+1):
        print(10 * i - 81)

Submission status: Wrong Answer

Solution code:
K = int(input())
count = 0
for i in range(1000000000000000):
    if(count == K):
        break
    num = 0
    try:
        tmp = str(i)
        for j in tmp:
            num += int(j)
        # print("n:{},  s:{}, ans ={}".format(i,num,int(i) / num))
        if(i != 0 and i < 10 or tmp[-1:] == "9"):
            print(i)
            count += 1
    except:
        print("zero")

Submission status: Wrong Answer

Solution code:
k = int(input())

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

n = 1
ans = set()
while(True):
    s_n = get_s(n)
    left = n / s_n
    is_not_sunuke = False
    for m in range(n + 1, n + 1 + 10):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

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

Submission status: Wrong Answer

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

k = int(input())
it = 0
for i in range(1, int(1e15)):
	if i < 10:
		print(i)
		it += 1
	else:
		if i%9 == 1 and i%10 != 0 and s(i) == 10:
			print(i)
			# print(i, i/s(i))
			it += 1
	if it == k:
		break

Submission status: Wrong Answer

Solution code:
K = int(raw_input())
for i in xrange(K):
  ans = 0
  k = i + 1
  while k / 9 != 0:
    ans += 9
    ans *= 10
    k -= 9
  ans += k
  print int(str(ans)[::-1])

Submission status: Wrong Answer

Solution code:
from operator import itemgetter
K = int(input())
def snuke(n):
    return n / sum([int(i) for i in str(n)])

L = [(i,snuke(i)) for i in range(1,10**5)]
L = [i[0] for i in sorted(L,key=itemgetter(1))[:K]]
print(*L,sep='\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 1
a = 0
b = 0
cnt = 0

for i in range(10**15):
    for j in str(i+1):
        a += int(j)
    for l in str(i+2):
        b += int(l)
    if (i+1) * b <= (i+2) * a:
        print(i+1)
        cnt += 1
        a = 0
        b = 0
        if cnt == k:
            break
    else:
        a = 0
        b = 0

Submission status: Wrong Answer

Solution code:
k = int(input())

nn = 0
for i in range(0, k):
    s = "9" * (i//9)
    p = i % 9 + 1
    print("%d%s" % (p, s))
    if k%9==0:
        nn+=1

Submission status: Wrong Answer

Solution code:
def f(x):
    x_str = str(x)
    y = x / sum([int(c) for c in x_str])
    return y


def count_digit(value):
    return len(str(value))


def g(k):
    count = 0
    digit = 1
    while True:
        if digit < 4:
            for i in range(1, 9 + 1):
                print(str(i) + '9' * (digit - 1))
                count += 1
                if count == k:
                    exit(0)
        else:
            for i in range(10, 10 + 10 * (digit - 3)):
                print(str(i) + '9' * (digit - 2))
                count += 1
                if count == k:
                    exit(0)
            for i in range(19 + 10 * (digit - 3), 100, 10):
                print(str(i) + '9' * (digit - 2))
                count += 1
                if count == k:
                    exit(0)

        digit += 1


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

    # exit(0)
    # # k = int(input())
    # k = 1000000000000000 // 100000000
    # min_f = k + 2
    # min_i = k + 2
    # for i in range(k + 1, 0, -1):
    #     fi = f(i)
    #     if fi <= min_f:
    #         min_f = fi
    #         min_i = i
    #         print(min_i, min_f)
    #     # print(i, fi, min_i, min_f)

Submission status: Wrong Answer

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

for j in range(20):
    for i in range(9):
        count += 1
        print((i + 1) * 10**j + 10 ** j - 1)
        if count == k:
            break
    else:
        continue
    break

Submission status: Wrong Answer

Solution code:
K = int(input())

tot = 1
nines = ''
while K >= tot:
    if tot < 10:
        print(tot)
        if K < tot:
            break
        tot += 1
        continue
    nines += '9'
    for i in range(1, 10):
        if K < tot:
            break
        print(str(i) + nines)
        tot += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
kyu = ""
c = 0
e = 1
while c < K:
    while e < 10 and c < K:
        print(int(str(e) + kyu))
        c += 1
        e += 1
    e = 1
    kyu += "9"

Submission status: Wrong Answer

Solution code:
K = int(input())
res = [1,2,3,4,5,6,7,8,9]
if K > len(res):
    for i in res:
        print(i)
    for j in range(K - len(res)):
        print(10*(j+1)+9)
else:
    for i in range(K):
        print(res[i])

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 9:
        print(i+1)
    else:
        for j in range(100):
            temp = j+1
            if i//(9*temp) == 0:
                break
        if j <= 2:
            print(10**j*(i-9*j+2)-1)
        else:
            print(10**j+99+100*(i-9*j))
            if i-9*j==8:
                break

for j in range(i,n-1):
    print(10**3+99+100*(j-9*3+1))

Submission status: Wrong Answer

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**100:
    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: Wrong Answer

Solution code:
k = int(input())
x = 1
for i in range(8):
    if (not k):
        break
    print(x)
    x += 1
    k -= 1
for i in range(9):
    if (not k):
        break
    print(x)
    x += 10
    k -= 1
p = 19
h = 10**2
while (k):
    for i in range(p):
        if (not k):
            break
        print(x)
        x += h
        k -= 1
    p += 9
    h *= 10

Submission status: Wrong Answer

Solution code:
def sumd(n):
    res=0
    while n>0:
        res+=(n%10)
        n=int(n/10)
    return res

k=int(input())

cnt=0
n=1
m=n+1
x=list()

while cnt<k:
    if (n/sumd(n))<=(m/sumd(m)):
        cnt+=1
        x.append(n)
    n+=1
    m=n+1
for i in x:
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())

count = 0
for i in range(1, pow(10, 15)):
    i_str = str(i)
    if count == k:
        break
    # 1の位
    if len(i_str) == 1:
        print(i)
        count+=1
    elif i_str[len(i_str)-1] == '9':
        print(i)
        count+=1

Submission status: Wrong Answer

Solution code:
n = int(input())

for i in range(n):
    if i < 9:
        print(i+1)
    else:
        for j in range(100):
            temp = j+1
            if i//(9*temp) == 0:
                break
        if j <= 2:
            print(10**j*(i-9*j+2)-1)
        else:
            print(10**j+99+100*(i-9*j))
            if i-9*j==8:
                break

for j in range(i,n):
    print(10**3+99+100*(j-9*3+1))

Submission status: Wrong Answer

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

a = k // 9
b = k % 9

if a == 0:
    for i in range(0,b):
        print(str(i+1))
else:
    for i in range(0,a):
        s = "9" * i
        for j in range(1,10):
            print(str(j)+s)
    s = s + "9"
    for i in range(0,b):
        print(str(i+1)+s)

Submission status: Wrong Answer

Solution code:
k = int(input())

j = 1
for i in range(1, k + 1):
    if i < 10:
        print(i)
    
    else:
        print(str(j) + str(9))
        j += 1

Submission status: Wrong Answer

Solution code:
K = input()
h = int(K)
i = 0

def all_nine(i):
    if i < 10: return True
    x = str(i)[1:]
    for y in x:
        if y != '9':
            return False
    # 二文字目以降すべて9
    return True

while h > 0:
    i += 1
    s = 0
    for j in str(i):
        s += int(j)
    #print(i, i/s)
    if all_nine(i):
        print(i)
    h -= 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
def digit_sum(i):
	list_i = [int(x) for x in str(i)]
	return sum(list_i)

K = int(input())
Sn = []
for i in range(2, pow(10, 15)):
	if (i - 1) / digit_sum(i-1) <= (i / digit_sum(i)):
		Sn.append(i - 1)
	if len(Sn) == K:
		break
for i in range(len(Sn)):
	print(Sn[i])

Submission status: Wrong Answer

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**1000:
    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: Wrong Answer

Solution code:
def digitSum(n):
    s = str(n)
    array = list(map(int, list(s)))
    return sum(array)

lst = [0]
ans = []
k = int(input())
tmp = 0
cnt = 0
i = 1
while cnt != k:
    if str(i)[1:] == '9'*(len(str(i))-1) or i < 10:
        print(i)
        cnt += 1

Submission status: Wrong Answer

Solution code:
K = int(input())
i = 1
lst = [1]
sz = 1

while i <= K:
    for j in range(sz-1, -1, -1):
        print(lst[j], end='')
    print()

    if lst[sz-1] == 9:
        lst.append(1)
        sz += 1
    else:
        lst[sz-1] += 1
    
    i += 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(10*(i+1)+9)

Submission status: Wrong Answer

Solution code:
m = int(input())
if m <= 9:
    for i in range(m):
        print(i+1)
else:
    for i in range(9):
        print(i+1)
    for i in range(m-9):
        print(str(i+1)+'9')

Submission status: Wrong Answer

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 len(str(n + 1)) > digits:
            digits += 1
        n += 10**(digits - 1)
    print(*num_list, sep='\n')

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1, k+1):
    div = i//9
    remain = i%9
    if remain > 0:
        ans = str(remain)+''.join(['9']*div)
    else:
        ans = ''.join(['9']*div)
    print(ans)

Submission status: Wrong Answer

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

K = int(input())

out = 0
i = 1
while True:

    N = i
    M = i + 1

    Sn = 0
    num = N
    while num != 0:
        Sn += num % 10
        num //= 10
    Sm = 0
    num = M
    while num != 0:
        Sm += num % 10
        num //= 10
    
    if N / Sn <= M / Sm:
        print(i)
        out += 1
        if out == K:
            exit()
    i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

r = 1
while K:
    print(r)
    r += 10**int(len(str(r + 1)) - 1)
    K -= 1

Submission status: Wrong Answer

Solution code:
q="D"
if q=="A":
	S=input()
	print(sum((i=="+")-(i=="-")for i in S))
if q=="B":
	a=int(input())
	b=sum(int(i) for i in str(a))
	print("Yes" if a%b==0 else "No")
if q=="C":
	N,K=map(int,input().split())
	A=[int(i) for i in input().split()]
	func=lambda a,b:int(a/b) if a%b==0 else int(a/b+1)
	print(1+func((len(A)-K),K-1))
if q=="D":
	K=int(input())
	S=lambda x:sum(int(i) for i in str(x))
	#for i in range(1,110):
	count=0
	i=1
	while True:
		print(i)
		i+=1
		count+=1
		if count==K or count==9:
			break
	i=1
	while True:
		print(i*10+9)
		i+=1
		count+=1
		if count==K:
			break

Submission status: Wrong Answer

Solution code:
k = int(input())

cnt = 0

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


for i in range(1, 10**15):
    if i/s(i) <= (i+1)/s(i+1):
        cnt += 1
        if cnt > k:
            exit()
        print(i)

Submission status: Wrong Answer

Solution code:
import sys
k = int(input())
cnt = 0
t = 0
while True:
    for i in range(1, 9):
        ans = i * 10**t
        if t == 0:
            print(ans)
        else:
            ans-=1
            print(ans)
        cnt += 1
        if cnt ==k:
            sys.exit()
    t += 1

Submission status: Wrong Answer

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

a = k // 9
b = k % 9
# 出力
for i in range(0,a):
    s = "9" * i
    for j in range(1,10):
        print(str(j)+s)
s = s + "9"
for i in range(0,b):
    print(str(i+1)+s)

Submission status: Wrong Answer

Solution code:
K = int(input())

#解答は簡単だけど数字を出力するのが面倒

for i in range(1,min(136,K+1)): #1からKまでだが、10^15以下制限により15桁9が続いたあとはすぬけ数は存在しないのでは？
    ansStr = ""
    ansStr += "9"*(i//9)
    if i%9 == 0:
        print(ansStr)
    else:
        print(str(i%9)+ansStr)

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

k =int(input())


for i in range(1,k+1):
    j = (i-1) // 9
    k = i - 9 * j
    p = k 
    for ii in range(j):
        p = p * 10 + 9
    print(p)

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
import math
k = int(input())
l = math.ceil(k/9)-1
for i in range(l+1):
    if i == l:
        for j in range(1,k%9+1):
            print(int(str(j)+"9"*i))
    else:
        for j in range(1,10):
            print(int(str(j)+"9"*i))

Submission status: Wrong Answer

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
    while len(num_list) < K:
        num_list.append(n)
        n += 10**(len(str(n)) - 1)
    print(*num_list, sep='\n')

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
K = int(input())

loop = 0

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

while(K >= 9):
  for i in range(2,11):
  	print((10**loop)*i-1)
  loop += 1
  K -= 9

j = 2
while(K > 0):
  print((10**loop)*j-1)
  K -= 1
  j += 1

Submission status: Wrong Answer

Solution code:
k = int(input())
idx = 0
if k< 10:
    for i in range(1,k+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    idx = 9
    power = 1
    flag=True
    while flag:
        for i in range(1,10):
            if idx >=k:
                flag = False
                break
            print(str(i)+str(10**power-1))
            idx+=1
        power+=1

Submission status: Wrong Answer

Solution code:
k = int(input())
j = 1
order = 1
for i in range(k):
    print(j)
    if (j + 1) % 10 ** order == 0:
        order += 1
    j += 10 ** (order - 1)

Submission status: Wrong Answer

Solution code:
KK=int(input())
for j in range(KK):
    K=j+1
    if K%9==0:print(9,end='')
    else: print(K%9,end='')
    for i in range((K-1)//9):
        print(9,end='')
    print('')

Submission status: Wrong Answer

Solution code:
k = int(input())

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

A = k // 9
B = k % 9
a = 1

if k >= 10:
    while a < A:
        print("\n".join(str(i)+"9"*a for i in range(1,10)))
        a += 1
    print("\n".join(str(i)+"9"*a for i in range(1,B)))

Submission status: Wrong Answer

Solution code:
K = int(input())

def sunuke(N):
    res = 0
    for n in str(N):
        res += int(n)
    return res


i, n = 0, 0
while i < K:
    n += 1
    if n / sunuke(n) <= ((n+1)/ sunuke(n+1)):
        print(n)
        i += 1

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# your code goes here
K = int(input())

for i in range(9):
	print(i+1)

ans_num = 9
i = 1
while ans_num < K:
	ans = 10*i+9
	ans_s = str(ans)
	flag = True
	for j in range(len(ans_s)-1):
		if ans_s[j] == '9':
			flag = False
			break
	if flag:
		print(ans)
		ans_num += 1
	i += 1

Submission status: Wrong Answer

Solution code:
K = input()
n = int(K)
Sn = 0
for k in K:
    Sn += int(k)

npSn = n / Sn

cnt = 0
while True:
    for i in range(1,10):
        print(i, end="")
        print("9"*(cnt//9))
        cnt += 1
        if cnt >= n:
            exit()

Submission status: Wrong Answer

Solution code:
K=int(input())
c=1
while K:
    print(c%10,c//10*'9',sep='')
    c+=1+(c%10==9)
    K-=1

Submission status: Wrong Answer

Solution code:
k=int(input())
ans=[1,2,3,4,5,6,7,8,9]
i=1
snuke=9
num=9
while len(ans)<k:
    snuke+=10**i
    ans.append(snuke)
    if snuke//(10**i)==num:
        num+=10**i
        i+=1
for i in range(k):
    print(ans[i])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
#! /usr/bin/env python3

k = int(input())

cnt = 0

digits = 0

while cnt < k:
    for i in range(1, 10):
        appendix = ''
        for a in range(digits):
            appendix = appendix + '9'

        print(str(i) + appendix)
        cnt += 1
        if cnt == k:
            break
        if i == 9:
            digits += 1

Submission status: Wrong Answer

Solution code:
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 + 3):
        s_m = get_s(m)
        right = m / s_m
        if left > right:
            is_not_sunuke = True
            break
    if not is_not_sunuke:
        ans.add(n)
    n += 1
    if len(ans) >= k:
        break

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

Submission status: Wrong Answer

Solution code:
k = int(input())

def digsums(x):
    s = str(x)
    sl = list(s)
    dig_sums = 0
    for i in sl:
        dig_sums += int(i)
    return dig_sums
    
    
if k <= 9 :
    roop = k
    for i in range(1,k+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    counter = 0
    max_count = k-9
    for i in range(19,1000000000000000,10):
        if digsums(i)<digsums(i+10):
            print(i)
            counter += 1
        if counter == max_count:
            break

Submission status: Wrong Answer

Solution code:
K = int(input())

loop = 0

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

while(K >= 9):
  for i in range(2,11):
  	print((10**loop)*i-1)
  loop += 1
  K -= 9

j = 1
while(K > 0):
  print((10**loop)*j-1)
  K -= 1
  j += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

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

start = 1
counter = 0

while counter < k:
    if sunuke(start) <= sunuke(start + 1):
        print(start)
        counter += 1
    start += 1

Submission status: Wrong Answer

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