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())
groupN = K//9
ingroup = K%9
l = []

for i in range(groupN):
    l.extend([j*(10**i)-1 for j in range(2,11)])

l.extend(((i+1)*(10**(groupN)))-1 for i in range(1,ingroup+1))
l.extend(list(range(1099,1900,100)))
l = sorted(l)

for i in l:
    print(i)

Submission status: Wrong Answer

Solution code:
K = int(input())
groupN = K//9
ingroup = K%9
l = []

for i in range(groupN):
    l.extend([j*(10**i)-1 for j in range(2,11)])

l.extend(((i+1)*(10**(groupN)))-1 for i in range(1,ingroup+1))
l.extend(list(range(1099,2000,100)))
l = sorted(l)

for i in l:
    print(i)

Submission status: Wrong Answer

Solution code:
K = int(input())
groupN = K//9
ingroup = K%9
l = []

for i in range(groupN):
    l.extend([j*(10**i)-1 for j in range(2,11)])

l.extend(((i+1)*(10**(groupN)))-1 for i in range(1,ingroup+1))

for i in l:
    print(i)

Submission status: Wrong Answer

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

def S(x):
	return sum(map(int, list(x)))
	
while count < K:
	m = str(n)
	
	if n < 10:
		m = "9"
	elif 9 < n < 100:
		m = m[0] + "9"
	else:
		m = m[0:-1] + "9"
		
	m_ = S(m)
	n_ = S(str(n))
	m = int(m)
	
	if (m/m_) >= (n/n_):
		print(n)
		count += 1
	n +=1

Submission status: Wrong Answer

Solution code:
k = input()

i = 1
s = 0
t = 0
r = 0
counter = 0
while True :
    r = i + 1
    r = str(r)
    i = str(i)
    for j in i :
        s += int(j)
    for j in r :
        t += int(j)
    
    i = int(i)

    if i*t <= (i+1)*s :
        counter += 1
        if int(k) == counter :
            print(i,end="")
            break
        print(i)
        
    i += 1
    s = 0
    t = 0
    r = 0

Submission status: Wrong Answer

Solution code:
k = input()

i = 1
s = 0
t = 0
r = 0
counter = 0
while True :
    r = i + 1
    r = str(r)
    i = str(i)
    for j in i :
        s += int(j)
    for j in r :
        t += int(j)
    
    i = int(i)

    if i*t <= (i+1)*s :
        print("")
        print(i,end="")
        counter += 1
    
    if int(k) == counter :
        break

    i += 1
    s = 0
    t = 0
    r = 0

Submission status: Wrong Answer

Solution code:
k = input()

i = 1
s = 0
t = 0
r = 0
counter = 0
while True :
    r = i + 1
    r = str(r)
    i = str(i)
    for j in i :
        s += int(j)
    for j in r :
        t += int(j)
    
    i = int(i)

    if i*t <= (i+1)*s :
        print(i)
        counter += 1
    
    if int(k) == counter :
        break

    i += 1
    s = 0
    t = 0
    r = 0

Submission status: Wrong Answer

Solution code:
i = int(input())

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

Submission status: Wrong Answer

Solution code:
K = int(input())
s = 0
for i in range(K):
    if i < 9:
        s += 1
    else:
        s += 10

    print(s)

Submission status: Wrong Answer

Solution code:
K = int(input())

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

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

Submission status: Wrong Answer

Solution code:
K = int(input())

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

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

Submission status: Wrong Answer

Solution code:
#QuestionD
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(1,k-8):
        print(9+10*i)

Submission status: Wrong Answer

Solution code:
n=int(input())
a,b=0,0
while b<n:
    a+=1
    x=10**len(str(max(a-20,0)))*2-1
    if a/sum(map(int,str(a))) <= float(x)/sum(map(int,str(x))):
        b+=1
        print(a)

Submission status: Wrong Answer

Solution code:
import math
n=int(input())
a,b=0,0
while b<n:
    a+=1
    x=math.ceil(a/10)*10-1
    #print(float(x),sum(map(int,str(x))))
    if a/sum(map(int,str(a)))<=float(x)/sum(map(int,str(x))):
        b+=1
        print(a)

Submission status: Wrong Answer

Solution code:
import math
# import datetime

def s(n):
	sum = 0
	for c in str(n):
		sum += int(c)
	return sum

k = int(input())
found=0

def next_sunuke(n, s_n, s_n_div):

	global found

	if n == 1:
		return

	log_n = int(math.log(n,10))
	m = n - 10 ** int(log_n // 1.25)
	# m = n - 1

	while m >= 1:
		s_m = s(m)
		s_mplus1 = s(m + 1)

		if (s_m < s_mplus1 or (s_n - s_m != 1 and s_n - s_m != -8)) and m > 9:
			m -= 10 ** int(log_n // 1.25)
			continue

		# print("check: " + str(m))

		s_m_div = m / s(m)

		if s_m_div <= s_n_div:
			next_sunuke(m, s_m, s_m_div)
			if found >= k:
				return

			found += 1
			# print("{0:d}".format(m), "{0:+d}".format(n-m), "{0:d}".format(s_m), s_m_div)
			print(m)
			break
		# else:
		# 	log_m = int(math.log(m,10))
		# 	if (m + 1) / (10 ** (log_m - 1)) == 19:

		# 		print ("skip: " + str(m) + " to " + str(10 ** log_m - 1))

		# 		m = 10 ** log_m - 1
		# 		s_mplus1 = s(m+1)
		# 		continue

		m -= 10 ** int(log_n // 1.25)


# 適当な大きいスヌケ数
current_sunuke = 999999999999999
s_current_sunuke = s(current_sunuke)
s_current_sunuke_div = current_sunuke / s_current_sunuke

# start = datetime.datetime.now()
next_sunuke(current_sunuke, s_current_sunuke, s_current_sunuke_div)
if found < k:
	print(current_sunuke)
# end = datetime.datetime.now()
# print(str(end-start))

# sunukes=[]

# n = current_sunuke - 1

# while(n >= 1):
# 	s_n = n / s(n)
# 	if s_n <= current_sunuke_n:
# 		#sunukes.insert(0,n)
# 		sunukes.append(n)
# 		current_sunuke = n
# 		current_sunuke_n = s_n
# 	n -= 1

# for n in sunukes:
# 	print (n)

Submission status: Wrong Answer

Solution code:
import math
# import datetime

def s(n):
	sum = 0
	for c in str(n):
		sum += int(c)
	return sum

k = int(input())
found=0

def next_sunuke(n, s_n, s_n_div):

	global found

	if n == 1:
		return

	log_n = int(math.log(n,10))
	m = n - 10 ** int(log_n // 1.25)
	# m = n - 1

	while m >= 1:
		s_m = s(m)
		s_mplus1 = s(m + 1)

		if (s_m < s_mplus1 or (s_n - s_m != 1 and s_n - s_m != -8)) and m > 9:
			m -= 10 ** int(log_n // 1.25)
			continue

		# print("check: " + str(m))

		s_m_div = m / s(m)

		if s_m_div <= s_n_div:
			next_sunuke(m, s_m, s_m_div)
			if found >= k:
				return

			found += 1
			# print("{0:d}".format(m), "{0:+d}".format(n-m), "{0:d}".format(s_m), s_m_div)
			print(m)
			break
		# else:
		# 	log_m = int(math.log(m,10))
		# 	if (m + 1) / (10 ** (log_m - 1)) == 19:

		# 		print ("skip: " + str(m) + " to " + str(10 ** log_m - 1))

		# 		m = 10 ** log_m - 1
		# 		s_mplus1 = s(m+1)
		# 		continue

		m -= 10 ** int(log_n // 1.25)


# 適当な大きいスヌケ数
current_sunuke = 999999999999999
s_current_sunuke = s(current_sunuke)
s_current_sunuke_div = current_sunuke / s_current_sunuke

# start = datetime.datetime.now()
next_sunuke(current_sunuke, s_current_sunuke, s_current_sunuke_div)
# end = datetime.datetime.now()
# print(str(end-start))

# sunukes=[]

# n = current_sunuke - 1

# while(n >= 1):
# 	s_n = n / s(n)
# 	if s_n <= current_sunuke_n:
# 		#sunukes.insert(0,n)
# 		sunukes.append(n)
# 		current_sunuke = n
# 		current_sunuke_n = s_n
# 	n -= 1

# for n in sunukes:
# 	print (n)

Submission status: Wrong Answer

Solution code:
import math
#import datetime

def s(n):
	sum = 0
	for c in str(n):
		sum += int(c)
	return sum

k = int(input())
found=0

def next_sunuke(n, s_n, s_n_div):

	global found

	if n == 1:
		return

	m = n - 1
	s_mplus1 = s(m + 1)

	while m >= 1:
		s_m = s(m)

		if (s_m < s_mplus1 or (s_n - s_m != 1 and s_n - s_m != -8)) and m > 9:
			m -= 1
			s_mplus1 = s_m
			continue

		# print("check: " + str(m))

		s_m_div = m / s(m)

		if s_m_div <= s_n_div:
			next_sunuke(m, s_m, s_m_div)
			if found >= k:
				return

			found += 1
			# print("{0:5d}".format(m), "{0:2d}".format(s_m), s_m_div)
			print(m)
			break
		# else:
		# 	log_m = int(math.log(m,10))
		# 	if (m + 1) / (10 ** (log_m - 1)) == 19:

		# 		print ("skip: " + str(m) + " to " + str(10 ** log_m - 1))

		# 		m = 10 ** log_m - 1
		# 		s_mplus1 = s(m+1)
		# 		continue
		m -= 1
		s_mplus1 = s_m


# 適当な大きいスヌケ数
current_sunuke = 999999
s_current_sunuke = s(current_sunuke)
s_current_sunuke_div = current_sunuke / s_current_sunuke

#start = datetime.datetime.now()
next_sunuke(current_sunuke, s_current_sunuke, s_current_sunuke_div)
#end = datetime.datetime.now()
#print(str(end-start))

# sunukes=[]

# n = current_sunuke - 1

# while(n >= 1):
# 	s_n = n / s(n)
# 	if s_n <= current_sunuke_n:
# 		#sunukes.insert(0,n)
# 		sunukes.append(n)
# 		current_sunuke = n
# 		current_sunuke_n = s_n
# 	n -= 1

# for n in sunukes:
# 	print (n)

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):
    ans = [(i, i/S(i)) for i in range(1, 10)]
    for i in range(16):
        a = i
        if a > 3:
            a = 3
        for j in range(1, 10**a):
            b = (10**(i-a+1))*j + (10**(i-a+1)-1)
            s = S(b)
            
            while ans[-1][1] > b/s or ans[-1][0] == b:
                ans.pop()
            ans.append((b, b/s))
            # print(ans[-1])
    # error_print(len(ans))
    # for r in ans:
    #     error_print(r)

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


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

if __name__ == '__main__':
    main()

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):
    ans = [(-1, 0)]
    for i in range(16):
        if i < 5:
            a = 1
        else:
            a = 4
        for j in range(1, 10**a):
            b = (10**(i-a+1))*j + (10**(i-a+1)-1)
            s = S(b)
            
            while ans[-1][1] > b/s or ans[-1][0] == b:
                ans.pop()
            ans.append((b, b/s))
            # print(ans[-1])
    ans.pop(0)
    
    return '\n'.join(map(str, map(lambda x: x[0], ans[:K])))


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

if __name__ == '__main__':
    main()

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):
    ans = [(-1, 0)]
    for i in range(16):
        if i < 5:
            a = 1
        else:
            a = 4
        for j in range(1, 10**a):
            b = (10**(i-a+1))*j + (10**(i-a+1)-1)
            s = S(b)
            
            while ans[-1][1] > b/s:
                ans.pop()
            ans.append((b, b/s))
            # print(ans[-1])
    ans.pop(0)

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


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

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n=int(input())
c=0
k=0
for i in range(1,n+1):
  k+=1
  if k==10:
    k=1
    c+=1
  print(k*10**c+int(0 if c==0 else '9'*c))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# -*- coding: utf-8 -*-
k = int(input())


def sn(n):
    sn = 0
    while n >= 10:
        n, s = divmod(n, 10)
        sn += s
    sn += n
    return sn


from math import log10


def digit(n):
    if n == 0:
        return 0

    return int(log10(n))


snuke = 0
for _ in range(k):
    tmp_digit = digit(snuke)
    snuke += 10**tmp_digit
    next_digit = digit(snuke)
    if next_digit > tmp_digit:
        snuke += 9 * 10**tmp_digit

    print(snuke)

Submission status: Wrong Answer

Solution code:
def Sunuke(ith):
    if ith<10:
        return ith
    jth = ith-9
    nn = jth*10+9
    if nn<100:
        return nn
    return nn*10+9
    
    

K = int(input())
for i in range(1, K+1):
    print(Sunuke(i))

Submission status: Wrong Answer

Solution code:
def s(n):
	sum = 0
	for c in str(n):
		sum += int(c)
	return sum

def isSunuke(n):
	for m in range(n+1, n * 100):
		if (n / s(n)) > (m / s(m)):
			return False
	return True

k = int(input())
found=0
n = 1
while(found < k):
	sn = str(n)
	length = len(sn)
	nines = 0
	for c in sn:
		if c == "9":
			nines += 1
	if nines < length / 2:
		n += 1
		continue
	if isSunuke(n):
		print(n)
		found+=1
	n += 1

Submission status: Wrong Answer

Solution code:
K = int(input())

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

Submission status: Wrong Answer

Solution code:
from itertools import islice
def snuke(n):
    return n / sum(int(c) for c in str(n))

def snukes():
    for i in range(1, 10):
        yield i
    i = 19
    while True:
        if snuke(i) <= snuke(i + 10):
            yield i
        i += 10

if __name__ == "__main__":
    n = int(input())
    for i in islice(snukes(), n):
        print(i)

Submission status: Wrong Answer

Solution code:
from itertools import islice
def snuke(n):
    return n / sum(int(c) for c in str(n))

def snukes():
    for i in range(1, 10):
        yield i
    i = 19
    while True:
        if snuke(i) < snuke(i + 10):
            yield i
        i += 10

if __name__ == "__main__":
    n = int(input())
    for i in islice(snukes(), n):
        print(i)

Submission status: Wrong Answer

Solution code:
from itertools import islice
def snuke(n):
    return n / sum(int(c) for c in str(n))

def snukes():
    for i in range(1, 10):
        yield i
    i = 19
    while True:
        if snuke(i) < snuke(i + 10):
            yield i
        i += 10

if __name__ == "__main__":
    n = int(input())
    print(list(islice(snukes(), n))[n - 1])

Submission status: Wrong Answer

Solution code:
import sys

K=int(input())


c=0
b=''
while 1:
  for i in range(10)[1:]:
    print(str(i)+b)
    c+=1
    if c>=K:
      sys.exit()
  b+='9'

Submission status: Wrong Answer

Solution code:
K=int(input())

c=0
i=1
while c<K:
  if i<10:
    print(i)
    c+=1
  elif (i+1)%10==0:
    print(i)
    c+=1
  i+=1

Submission status: Wrong Answer

Solution code:
K=int(input())

j=-((27-K)//90)
for i in range(min(9,K)):
    print(str(i+1))
for i in range(min(9,K-9)):
    print(str(i+1)+"9")
for i in range(min(9,K-18)):
    print(str(i+1)+"99")
for i in range(j):
    if i==j-1:
        for k in range((K-27)%90+1):
            print(str(k+10)+"9"*(i+2))
    else:
        for k in range(90):
            print(str(k+10)+"9"*(i+2))

Submission status: Wrong Answer

Solution code:
K=int(input())
 
for i in range(min(9,K)):
    print(str(i+1))
for i in range(min(9,K-9)):
    print(str(i+1)+"9")
for i in range(K-18):
    print(str(i+1)+"99")

Submission status: Wrong Answer

Solution code:
K=int(input())

i=-((-K)//9)
j=((K-1)%9)+1
for n in range(i):
    if n==i-1:
        for m in range(j):
            print(str(m+1)+"9"*n)
    else:
        for m in range(9):
            print(str(m+1)+"9"*n)

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
tencount=0
keta=0

for i in range(1,N+1):
  count+=1
  print(count*(10**tencount)+keta)
  if count==9:
    count=0
    keta+=(10**tencount)*9
    tencount+=1

'''
for i in range(99,1000,100):
  listi=list(str(i))
  print(i/sum(map(int,listi)))
'''

Submission status: Wrong Answer

Solution code:
N=int(input())
count=0
tencount=1

for i in range(1,N+1):
  if count<9:
    print(i)
    count+=1
  else:
    print(tencount*10+9)
    tencount+=1

Submission status: Wrong Answer

Solution code:
def main():
    """
    1 <= K
    sunuke_K <= 10^15

    すぬけ数
        m > n
        n / S(n) <= m / S(m)

    s(n) >
    """
    K = int(input())

    #answers = editorial(K)
    answers = ex(K)
    for ans in answers:
        print(ans)


def ex(K):
    base = 1
    answers = []
    x = 0
    while len(answers) < K:
        if len(str(x)) != len(str(x + base)):
            base *= 10
        x += base
        answers.append(x)

    return answers


if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
K = int(raw_input())

count = 0
s = 0
for i in range(K):
    s += 1
    if s==10:
        count += 1
        s = 1
    print str(s) + '9'*count

Submission status: Wrong Answer

Solution code:
K = int(raw_input())

count = 0
s = 0
for i in range(K):
    s += 1
    if s==10:
        count += 1
        s = 1
    print i, str(s) + '9'*count

Submission status: Wrong Answer

Solution code:
K = int(input())

def S(number):
    return sum([int(i) for i in str(number)])

def find_sunuke():
    found = 0
    n = 1

    while True:
        for m in range(n+1, n+2):
            if n/S(n) <= m/S(m):
                print(n)
                found += 1
                if found == K:
                    return
                break
        n += 1

find_sunuke()

Submission status: Wrong Answer

Solution code:
# from itertools import product
# from functools import reduce

# K = 30


# k = 3

# for n in product(range(10), repeat=k):
#   val = 0
#   for i, m in enumerate(n):
#     val += m*(10**(k-1-i))
#   if val == 0:
#     continue
#   print(val, sum(n), val/sum(n))

K = int(input())

cnt = 0

for i in range(17):
  for j in range(1,10):
    print(str(j) + str(9)*i)
    cnt += 1
    if cnt == K:
      break
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
# from itertools import product
# from functools import reduce

# K = 30


# k = 3

# for n in product(range(10), repeat=k):
#   val = 0
#   for i, m in enumerate(n):
#     val += m*(10**(k-1-i))
#   if val == 0:
#     continue
#   print(val, sum(n), val/sum(n))

K = int(input())

cnt = 0

for i in range(16):
  for j in range(1,10):
    print(str(j) + str(9)*i)
    cnt += 1
    if cnt == K:
      break
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
# from itertools import product
# from functools import reduce

# K = 30


# k = 3

# for n in product(range(10), repeat=k):
#   val = 0
#   for i, m in enumerate(n):
#     val += m*(10**(k-1-i))
#   if val == 0:
#     continue
#   print(val, sum(n), val/sum(n))

K = int(input())

cnt = 0

for i in range(15):
  for j in range(1,10):
    print(str(j) + str(9)*i)
    cnt += 1
    if cnt == K:
      break
  else:
    continue
  break

Submission status: Wrong Answer

Solution code:
K = int(input())
num = 1
count = 0
power = 1
while count < K:
    print(num)
    count += 1
    num += power
    if num + 1 == 10 * power:
        power *= 10

Submission status: Wrong Answer

Solution code:

def main():
    ss = input().strip()
    k = int(ss)

    def fs(n):
        s = 0
        for i in str(n):
            s += int(i)

        return s
        
    s = ""
    suke1s = []
    try:
        for j in range(1, 17):
            for i in range(1, 10):
                #print("{}{}".format(i, s))
                n = int("{}{}".format(i, s))
                suke1s.append(n)
                if n > 10 ** 17:
                    raise StopIteration
                
            s = "9" * j
    except:
        pass
            
    ki = 0
    sukes = []
    ns = [n/fs(n) for n in suke1s]

    for i, ni in enumerate(ns):
        if ni == min(ns[i:]):
            sukes.append(suke1s[i])
            #print(ni)

    for s in sukes[0:k]:
        print(s)
            
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:

def main():
    ss = input().strip()
    k = int(ss)

    def fs(n):
        s = 0
        for i in str(n):
            s += int(i)

        return s
        
    s = ""
    suke1s = []
    try:
        for j in range(1, 16):
            for i in range(1, 10):
                #print("{}{}".format(i, s))
                n = int("{}{}".format(i, s))
                suke1s.append(n)
                if n > 10 ** 16:
                    raise StopIteration
                
            s = "9" * j
    except:
        pass
            
    ki = 0
    sukes = []
    ns = [n/fs(n) for n in suke1s]

    for i, ni in enumerate(ns):
        if ni == min(ns[i:]):
            sukes.append(suke1s[i])
            #print(ni)

    for s in sukes[0:k]:
        print(s)
            
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
#abc101d

def f(n):
 s=str(n)
 t=0
 for i in xrange(len(s)):
  t+=int(s[i])
 return n/t

k=int(raw_input())
x,y=1,1
for i in xrange(k):
 print x
 if f(x+10**(y-1))>f(x+10**y):
  y+=1
 x+=10**(y-1)

Submission status: Wrong Answer

Solution code:
k = int(input())

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

l = 1

while len(s) < k:
    for i in range(2, 11):
        s.append((10 ** l) * i - 1)
        if len(s) >= k:
            break
    l += 1


for i in s:
    print(i)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-


def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]
for i in range(0,16):
    for j in range(1,151):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()

for i in range(0,len(A)-1):
    #for j in range(i+1,len(A)):
        N=Sooo(A[i])
        M=Sooo(A[i+1])
        if N>M:
            A[i]=1

A = list(set(A))
A.sort()

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

Submission status: Wrong Answer

Solution code:

def main():
    ss = input().strip()
    k = int(ss)

    s = ""
    n = 0
    for j in range(1, 16):
        for i in range(1, 10):
            print("{}{}".format(i, s))
            n += 1
            if n >= k:
                return
                
        s = "9" * j
            
if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
n = int(input())

suf = ""
minus = 0
for i in range(1,n+1):
    print(str(i - minus) + suf)
    if i % 9 == 0:
        suf += "9"
        minus += 9

Submission status: Wrong Answer

Solution code:
# coding: utf-8
def s(n):
    return sum(map(int,str(n)))

k=int(input())
if k<10:
    for i in range(1,k+1):
        print(i)
else:
    for i in range(1,10):
        print(i)
    k-=9
    s='1'
    for i in range(k):
        print(s+'9')
        s+='9'

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]
for i in range(0,37):
    for j in range(1,200):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()
l=len(A)
#print(l)
for i in range(l-1):
        N=Sooo(A[i])
        M=Sooo(A[i+1])
        if N>M:
            A[i]=0
A = list(set(A))
A.sort()
for i in range(K):
    print(A[i+1])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]
for i in range(0,16):
    for j in range(1,151):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()
l=len(A)
#print(l)
for i in range(l-1):
        N=Sooo(A[i])
        M=Sooo(A[i+1])
        if N>M:
            A[i]=0
A = list(set(A))
A.sort()

for i in range(K):
    print(A[i+1])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]
for i in range(0,16):
    for j in range(1,151):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()
l=len(A)
#print(l)
for i in range(l-1):
        N=Sooo(A[i])
        M=Sooo(A[i+1])
        if N>M:
            A[i]=0

for i in A:
    if i==0:
        A.remove(i)
for i in range(K):
    print(A[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []

def Sooo(N):
    return float(N/sum(digit(N)))
base=1
A=[]
for i in range(0,16):
    for j in range(1,151):
        re=base*(j+1)-1
        A.append(int(re))
    base = base*10
A = list(set(A))
A.sort()
l=len(A)
#print(l)
for i in range(l-1):
        N=Sooo(A[i])
        M=Sooo(A[i+1])
        if N>M:
            A[i]=0

for i in A:
    if i==0:
        A.remove(i)
for i in range(K+1):
    print(A[i])

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []
F=0
N=0
d=0

def func(F,d,N):
    for i in range(1,10):
        n = N+i*(10**d)
        Sn = sum(digit(n))
        X = N+9*(10**d)
        SX = sum(digit(N+9*(10**d)))
        #print(n,Sn,X,SX)
    
        #if ((n/Sn)<=(X/SX)):
        if n>10**15:
            exit()
        print(n)
        F=F+1
        if F==K:
            exit()

    N=N+9*(10**d)
    d=d+1
    return F,d,N 


while True:
    F,d,N=func(F,d,N)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []
F=0
N=0
d=0

def func(F,d,N):
    for i in range(1,10):
        n = N+i*(10**d)
        Sn = sum(digit(n))
        X = N+9*(10**d)
        SX = sum(digit(N+9*(10**d)))
        #print(n,Sn,X,SX)
        #if ((n/Sn)<=(X/SX)):
        print(n)
        F=F+1
        if F==K:
            exit()

    N=N+9*(10**d)
    d=d+1
    return F,d,N 


while True:
    F,d,N=func(F,d,N)

Submission status: Wrong Answer

Solution code:
#!/usr/bin/env python
# -*- coding:utf-8 -*-

K = int(input())

def digit(i):
    if i>0:
        return digit(i//10)+[i%10]
    else:
        return []
F=0
N=0
d=0

def func(F,d,N):
    for i in range(1,10):
        n = N+i*(10**d)
        Sn = sum(digit(n))
        X = N+9*(10**d)
        SX = sum(digit(N+9*(10**d)))
        #print(n,Sn,X,SX)
        if ((n/Sn)<=(X/SX)):
            print(n)
            F=F+1
        if F==K:
            exit()

    N=N+9*(10**d)
    d=d+1
    return F,d,N 


while True:
    F,d,N=func(F,d,N)

Submission status: Wrong Answer

Solution code:
K = int(input())

counter = 1
keta = 1
nine = 0


while K > 0:
	ans = counter * keta + nine
	
	print (ans)
	
	counter += 1
	K -= 1
	
	if counter == 10:
		counter = 1
		keta *= 10
		nine = nine * 10 + 9

Submission status: Wrong Answer

Solution code:
k = int(input())
end = 0
nine = 0
while end == 0:
    for i in range(9):
        ans = [str(i + 1)]
        ans += "9" * nine
        print("".join(ans))
        k -= 1
        if k == 0:
            end = 1
            break
    nine += 1

Submission status: Wrong Answer

Solution code:
k = int(input())

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

l = 1

while len(s) < k:
    for i in range(1, 11):
        s.append((10 ** l) * i - 1)
        if len(s) >= k:
            break
    l += 1


for i in s:
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())

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

l = 1

while len(s) <= k:
    for i in range(1, 11):
        s.append((10 ** l) * i - 1)
        if len(s) > k:
            break
    l += 1


for i in s:
    print(i)

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(1,k+1):
    if i/10 == 0:
        print(i)
    else:
        print(str(i-9) + str(9))

Submission status: Wrong Answer

Solution code:
if __name__ == '__main__':
    K = int(input())

    s = []
    n = 0
    
    j = '0'
    while True:
        for i in range(1, 10):
            if j == '0':
                print(i)
            else:
                print(str(i) + j)
            K = K - 1
            if K == 0:
                exit()
        if j == '0':
            j = '9'
        else:
            j = j + '9'

Submission status: Wrong Answer

Solution code:
import math

for i in range(int(input())):
    print(int(str(i%9+1)+'9'*math.floor(i/9)))

Submission status: Wrong Answer

Solution code:
import math

for i in range(int(input())):
    print(str(i%9+1)+'9'*math.floor(i/9))