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:
'''
def f(s):
    ret = 0
    while s:
        ret = ret + s % 10
        s = s // 10
    return ret

for i in range(1,30000):
    if( i % 1000 == 999):
        print("#{} : {:.9f}".format(i, i/f(i)))
'''

a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199]
k = int(input())
for i in range(min(k, len(a))):
    print(a[i])
for i in range(k-len(a)):
    print(str(i%18 + 2) + "9" * (i//18) + "99")

Submission status: Wrong Answer

Solution code:
k = int(input())

for i in range(k):
    print(str(i%9 + 1) + "9" * (i//9))

Submission status: Wrong Answer

Solution code:
K = int(input())
maxnum = 10**20
al = []
ERROR  = 10**(-10)

def sunuke(i):
    s = 0
    old = i
    while i>0:
        s += i%10
        i = i//10
    return [old/s,old]

for i in range(1,100):
    al.append(sunuke(i))
for j in range(3,17):
    for k in range(10,100):
        al.append(sunuke(k*(10**(j-2))+10**(j-2)-1))
anslist = []
al.reverse()
for j in al:
    if j[0]<maxnum+ERROR:
        anslist.append(j[1])
        maxnum = j[0]
anslist.reverse()

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

Submission status: Wrong Answer

Solution code:
K = int(input())
maxnum = 10**20
al = []
ERROR  = 10**(-10)

def sunuke(i):
    s = 0
    old = i
    while i>0:
        s += i%10
        i = i//10
    return [old/s,old]

for i in range(1,100):
    al.append(sunuke(i))
for j in range(3,17):
    for k in range(10,100):
        al.append(sunuke(k*(10**(j-2))+10**(j-2)-1))
anslist = []
al.reverse()
for j in al:
    if j[0]<maxnum+ERROR:
        anslist.append(j[1])
        maxnum = j[0]
anslist.reverse()

for i in range(K):
    print(anslist[i])
print(len(anslist))

Submission status: Wrong Answer

Solution code:
K = int(input())
maxnum = 10**20
al = []

def sunuke(i):
    s = 0
    old = i
    while i>0:
        s += i%10
        i = i//10
    return [old/s,old]

for i in range(1,100):
    al.append(sunuke(i))
for j in range(3,17):
    for k in range(10,100):
        al.append(sunuke(k*(10**(j-2))+10**(j-2)-1))
anslist = []
al.reverse()
for j in al:
    if j[0]<=maxnum:
        anslist.append(j[1])
        maxnum = j[0]
anslist.reverse()

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

Submission status: Wrong Answer

Solution code:
a, b = 1, 1
for i in range(int(input())):
	print(a)
	if a + 1 == b * 10:
		a, b = a * 2 + 1, b * 10
	else:
		a += b

Submission status: Wrong Answer

Solution code:
k = int(input())
i = 9
ans = [1,2,3,4,5,6,7,8,9]
while i < k:
    ans += [10**(i//9)*j+9 for j in range(1,10)]
    i += 9
print(*ans[:k], sep='\n')

Submission status: Wrong Answer

Solution code:
# -*- coding:utf-8 -*-
s = []

for i in range(1, 10):
    s.append(i)


def cal(x):
    t = 0
    while x:
        t = t * 10 + 9
        x -= 1
    return t


for j in range(1, 15):
    base = cal(j)
    for i in range(1, 10):
        s.append(i * (10 ** j) + base)

k = int(input())
for x in s[:k]:
    print(x)

Submission status: Wrong Answer

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

#for i in range(math.ceil(k/9) - 1):
#    for j in range(9):
#        print(int(str(j+1) + '9'*i))
#        num = int(str(j+1) + '9'*i)
#    print(num/sum([int(l) for l in str(num)]))
def pf(num):
    return float(num)/sum([int(l) for l in str(num)])
for i in range(min(k, 8)):
    print(i+1)

k-= min(k,8)

temp = 0
for i in range(pow(10, 27)):
    num = int(str(i) + '9')
    x = pf(num)
    if x - temp >= 0:
        k -= 1
        print(num)
        if k == 0:
            break
    temp = pf(num)

#for j in range(k%9 if k%9 !=0 else 9):
#    print(int(str(j+1) + '9'*(math.ceil(k/9)-1)))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
limits = {9, 99} | {int(str(i) + "9" * (i + 2)) for i in range(1, 10)}
K = int(input())
inc = 1
last = 0
for i in range(K):
    last += inc
    if last in limits:
        inc *= 10
    print(last)

Submission status: Wrong Answer

Solution code:
ans=[1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,199,299,399,499,599,699,799,899,999,1099,1199,1299,1399,1499,1599,1699,1799,1899,1999,2999,3999,4999,5999,6999,7999,8999,9999,10999,11999,12999,13999,14999,15999,16999,17999,18999,19999,20999,21999,22999,23999,24999,25999,26999,27999,28999,29999,39999,49999,59999,69999,79999,89999,99999,109999,119999,129999,139999,149999,159999,169999,179999,189999,199999,209999,219999,229999,239999,249999,259999,269999,279999,289999,299999,309999,319999,329999,339999,349999,359999,369999,379999,389999,399999,499999,599999,699999,799999,899999,999999,1099999,1199999,1299999,1399999,1499999,1599999,1699999,1799999,1899999,1999999,2099999,2199999,2299999,2399999,2499999,2599999,2699999,2799999,2899999,2999999,3099999,3199999,3299999,3399999,3499999,3599999,3699999,3799999,3899999,3999999,4099999,4199999,4299999,4399999,4499999,4599999,4699999,4799999,4899999,4999999,5999999,6999999,7999999,8999999,9999999,10999999,11999999,12999999,13999999,14999999,15999999,16999999,17999999,18999999,19999999,20999999,21999999,22999999,23999999,24999999,25999999,26999999,27999999,28999999,29999999,30999999,31999999,32999999,33999999,34999999,35999999,36999999,37999999,38999999,39999999,40999999,41999999,42999999,43999999,44999999,45999999,46999999,47999999,48999999,49999999,50999999,51999999,52999999,53999999,54999999,55999999,56999999,57999999,58999999,59999999,69999999,79999999,89999999,99999999,109999999,119999999,129999999,139999999,149999999,159999999,169999999,179999999,189999999,199999999,209999999,219999999,229999999,239999999,249999999,259999999,269999999,279999999,289999999,299999999,309999999,319999999,329999999,339999999,349999999,359999999,369999999,379999999,389999999,399999999,409999999,419999999,429999999,439999999,449999999,459999999,469999999,479999999,489999999,499999999,509999999,519999999,529999999,539999999,549999999,559999999,569999999,579999999,589999999,599999999,609999999,619999999,629999999,639999999,649999999,659999999,669999999,679999999,689999999,699999999,799999999,899999999,999999999,1099999999,1199999999,1299999999,1399999999,1499999999,1599999999,1699999999,1799999999,1899999999,1999999999,2099999999,2199999999,2299999999,2399999999,2499999999,2599999999,2699999999,2799999999,2899999999,2999999999,3099999999,3199999999,3299999999,3399999999,3499999999,3599999999,3699999999,3799999999,3899999999,3999999999,4099999999,4199999999,4299999999,4399999999,4499999999,4599999999,4699999999,4799999999,4899999999,4999999999,5099999999,5199999999,5299999999,5399999999,5499999999,5599999999,5699999999,5799999999,5899999999,5999999999,6099999999,6199999999,6299999999,6399999999,6499999999,6599999999,6699999999,6799999999,6899999999,6999999999,7099999999,7199999999,7299999999,7399999999,7499999999,7599999999,7699999999,7799999999,7899999999,7999999999,8999999999,9999999999,10999999999,11999999999,12999999999,13999999999,14999999999,15999999999,16999999999,17999999999,18999999999,19999999999,20999999999,21999999999,22999999999,23999999999,24999999999,25999999999,26999999999,27999999999,28999999999,29999999999,30999999999,31999999999,32999999999,33999999999,34999999999,35999999999,36999999999,37999999999,38999999999,39999999999,40999999999,41999999999,42999999999,43999999999,44999999999,45999999999,46999999999,47999999999,48999999999,49999999999,50999999999,51999999999,52999999999,53999999999,54999999999,55999999999,56999999999,57999999999,58999999999,59999999999,60999999999,61999999999,62999999999,63999999999,64999999999,65999999999,66999999999,67999999999,68999999999,69999999999,70999999999,71999999999,72999999999,73999999999,74999999999,75999999999,76999999999,77999999999,78999999999,79999999999,80999999999,81999999999,82999999999,83999999999,84999999999,85999999999,86999999999,87999999999,88999999999,89999999999,99999999999,109999999999,119999999999,129999999999,139999999999,149999999999,159999999999,169999999999,179999999999,189999999999,199999999999,209999999999,219999999999,229999999999,239999999999,249999999999,259999999999,269999999999,279999999999,289999999999,299999999999,309999999999,319999999999,329999999999,339999999999,349999999999,359999999999,369999999999,379999999999,389999999999,399999999999,409999999999,419999999999,429999999999,439999999999,449999999999,459999999999,469999999999,479999999999,489999999999,499999999999,509999999999,519999999999,529999999999,539999999999,549999999999,559999999999,569999999999,579999999999,589999999999,599999999999,609999999999,619999999999,629999999999,639999999999,649999999999,659999999999,669999999999,679999999999,689999999999,699999999999,709999999999,719999999999,729999999999,739999999999,749999999999,759999999999,769999999999,779999999999,789999999999,799999999999,809999999999,819999999999,829999999999,839999999999,849999999999,859999999999,869999999999,879999999999,889999999999,899999999999,909999999999,919999999999,929999999999,939999999999,949999999999,959999999999,969999999999,979999999999,989999999999,999999999999,1099999999999,1199999999999,1299999999999,1399999999999,1499999999999,1599999999999,1699999999999,1799999999999,1899999999999,1999999999999,2099999999999,2199999999999,2299999999999,2399999999999,2499999999999,2599999999999,2699999999999,2799999999999,2899999999999,2999999999999,3099999999999,3199999999999,3299999999999,3399999999999,3499999999999,3599999999999,3699999999999,3799999999999,3899999999999,3999999999999,4099999999999,4199999999999,4299999999999,4399999999999,4499999999999,4599999999999,4699999999999,4799999999999,4899999999999,4999999999999,5099999999999,5199999999999,5299999999999,5399999999999,5499999999999,5599999999999,5699999999999,5799999999999,5899999999999,5999999999999,6099999999999,6199999999999,6299999999999,6399999999999,6499999999999,6599999999999,6699999999999,6799999999999,6899999999999,6999999999999,7099999999999,7199999999999,7299999999999,7399999999999,7499999999999,7599999999999,7699999999999,7799999999999,7899999999999,7999999999999,8099999999999,8199999999999,8299999999999,8399999999999,8499999999999,8599999999999,8699999999999,8799999999999,8899999999999,8999999999999,9099999999999,9199999999999,9299999999999,9399999999999,9499999999999,9599999999999,9699999999999,9799999999999,9899999999999,9999999999999,10999999999999,11999999999999,12999999999999,13999999999999,14999999999999,15999999999999,16999999999999,17999999999999,18999999999999,19999999999999,20999999999999,21999999999999,22999999999999,23999999999999,24999999999999,25999999999999,26999999999999,27999999999999,28999999999999,29999999999999,30999999999999,31999999999999,32999999999999,33999999999999,34999999999999,35999999999999,36999999999999,37999999999999,38999999999999,39999999999999,40999999999999,41999999999999,42999999999999,43999999999999,44999999999999,45999999999999,46999999999999,47999999999999,48999999999999,49999999999999,50999999999999,51999999999999,52999999999999,53999999999999,54999999999999,55999999999999,56999999999999,57999999999999,58999999999999,59999999999999,60999999999999,61999999999999,62999999999999,63999999999999,64999999999999,65999999999999,66999999999999,67999999999999,68999999999999,69999999999999,70999999999999,71999999999999,72999999999999,73999999999999,74999999999999,75999999999999,76999999999999,77999999999999,78999999999999,79999999999999,80999999999999,81999999999999,82999999999999,83999999999999,84999999999999,85999999999999,86999999999999,87999999999999,88999999999999,89999999999999,90999999999999,91999999999999,92999999999999,93999999999999,94999999999999,95999999999999,96999999999999,97999999999999,98999999999999,99999999999999,100999999999999,101999999999999,102999999999999,103999999999999,104999999999999,105999999999999,106999999999999,107999999999999,108999999999999,109999999999999,119999999999999,129999999999999,139999999999999,149999999999999,159999999999999,169999999999999,179999999999999,189999999999999,199999999999999,209999999999999,219999999999999,229999999999999,239999999999999,249999999999999,259999999999999,269999999999999,279999999999999,289999999999999,299999999999999,309999999999999,319999999999999,329999999999999,339999999999999,349999999999999,359999999999999,369999999999999,379999999999999,389999999999999,399999999999999,409999999999999,419999999999999,429999999999999,439999999999999,449999999999999,459999999999999,469999999999999,479999999999999,489999999999999,499999999999999,509999999999999,519999999999999,529999999999999,539999999999999,549999999999999,559999999999999,569999999999999,579999999999999,589999999999999,599999999999999,609999999999999,619999999999999,629999999999999,639999999999999,649999999999999,659999999999999,669999999999999,679999999999999,689999999999999,699999999999999,709999999999999,719999999999999,729999999999999,739999999999999,749999999999999,759999999999999,769999999999999,779999999999999,789999999999999,799999999999999,809999999999999,819999999999999,829999999999999,839999999999999,849999999999999,859999999999999,869999999999999,879999999999999,889999999999999,899999999999999,909999999999999,919999999999999,929999999999999,939999999999999,949999999999999,959999999999999,969999999999999,979999999999999,989999999999999,999999999999999,1009999999999999,1019999999999999,1029999999999999,1039999999999999,1049999999999999,1059999999999999,1069999999999999,1079999999999999,1089999999999999,1099999999999999,1109999999999999,1119999999999999,1129999999999999,1139999999999999,1149999999999999,1159999999999999,1169999999999999,1179999999999999,1189999999999999,1199999999999999,1299999999999999,1399999999999999,1499999999999999,1599999999999999,1699999999999999,1799999999999999,1899999999999999,1999999999999999,2099999999999999,2199999999999999,2299999999999999,2399999999999999,2499999999999999,2599999999999999,2699999999999999,2799999999999999,2899999999999999,2999999999999999,3099999999999999,3199999999999999,3299999999999999,3399999999999999,3499999999999999,3599999999999999,3699999999999999,3799999999999999,3899999999999999,3999999999999999,4099999999999999,4199999999999999,4299999999999999,4399999999999999,4499999999999999,4599999999999999,4699999999999999,4799999999999999,4899999999999999,4999999999999999,5099999999999999,5199999999999999,5299999999999999,5399999999999999,5499999999999999,5599999999999999,5699999999999999,5799999999999999,5899999999999999,5999999999999999,6099999999999999,6199999999999999,6299999999999999,6399999999999999,6499999999999999,6599999999999999,6699999999999999,6799999999999999,6899999999999999,6999999999999999,7099999999999999,7199999999999999,7299999999999999,7399999999999999,7499999999999999,7599999999999999,7699999999999999,7799999999999999,7899999999999999,7999999999999999,8099999999999999,8199999999999999,8299999999999999,8399999999999999,8499999999999999,8599999999999999,8699999999999999,8799999999999999,8899999999999999,8999999999999999,9099999999999999,9199999999999999,9299999999999999,9399999999999999,9499999999999999,9599999999999999,9699999999999999,9799999999999999,9899999999999999,9999999999999999,10099999999999999,10199999999999999,10299999999999999,10399999999999999,10499999999999999,10599999999999999,10699999999999999,10799999999999999,10899999999999999,10999999999999999,11099999999999999,11199999999999999,11299999999999999,11399999999999999,11499999999999999,11599999999999999,11699999999999999,11799999999999999,11899999999999999,11999999999999999,12099999999999999,12199999999999999,12299999999999999,12399999999999999,12499999999999999,12599999999999999,12699999999999999,12799999999999999,12899999999999999,12999999999999999,13999999999999999,14999999999999999,15999999999999999,16999999999999999,17999999999999999,18999999999999999,19999999999999999,20999999999999999,21999999999999999,22999999999999999,23999999999999999,24999999999999999,25999999999999999,26999999999999999,27999999999999999,28999999999999999,29999999999999999,30999999999999999,31999999999999999,32999999999999999,33999999999999999,34999999999999999,35999999999999999,36999999999999999,37999999999999999,38999999999999999,39999999999999999,40999999999999999,41999999999999999,42999999999999999,43999999999999999,44999999999999999,45999999999999999,46999999999999999,47999999999999999,48999999999999999,49999999999999999,50999999999999999,51999999999999999,52999999999999999,53999999999999999,54999999999999999,55999999999999999,56999999999999999,57999999999999999,58999999999999999,59999999999999999,60999999999999999,61999999999999999,62999999999999999,63999999999999999,64999999999999999,65999999999999999,66999999999999999,67999999999999999,68999999999999999,69999999999999999,70999999999999999,71999999999999999,72999999999999999,73999999999999999,74999999999999999,75999999999999999,76999999999999999,77999999999999999,78999999999999999,79999999999999999,80999999999999999,81999999999999999,82999999999999999,83999999999999999,84999999999999999,85999999999999999,86999999999999999,87999999999999999,88999999999999999,89999999999999999,90999999999999999,91999999999999999,92999999999999999,93999999999999999,94999999999999999,95999999999999999,96999999999999999,97999999999999999,98999999999999999,99999999999999999,100999999999999999,101999999999999999,102999999999999999,103999999999999999,104999999999999999,105999999999999999,106999999999999999,107999999999999999,108999999999999999,109999999999999999,110999999999999999,111999999999999999,112999999999999999,113999999999999999,114999999999999999,115999999999999999,116999999999999999,117999999999999999,118999999999999999,119999999999999999,120999999999999999,121999999999999999,122999999999999999,123999999999999999,124999999999999999,125999999999999999,126999999999999999,127999999999999999,128999999999999999,129999999999999999,130999999999999999,131999999999999999,132999999999999999,133999999999999999,134999999999999999,135999999999999999,136999999999999999,137999999999999999,138999999999999999,139999999999999999,149999999999999999,159999999999999999,169999999999999999,179999999999999999,189999999999999999,199999999999999999,209999999999999999,219999999999999999,229999999999999999,239999999999999999,249999999999999999,259999999999999999,269999999999999999,279999999999999999,289999999999999999,299999999999999999,309999999999999999,319999999999999999,329999999999999999,339999999999999999,349999999999999999,359999999999999999,369999999999999999,379999999999999999,389999999999999999,399999999999999999,409999999999999999,419999999999999999,429999999999999999,439999999999999999,449999999999999999,459999999999999999,469999999999999999,479999999999999999,489999999999999999,499999999999999999,509999999999999999,519999999999999999,529999999999999999,539999999999999999,549999999999999999,559999999999999999,569999999999999999,579999999999999999,589999999999999999,599999999999999999,609999999999999999,619999999999999999,629999999999999999,639999999999999999,649999999999999999,659999999999999999,669999999999999999,679999999999999999,689999999999999999,699999999999999999,709999999999999999,719999999999999999,729999999999999999,739999999999999999,749999999999999999,759999999999999999,769999999999999999,779999999999999999,789999999999999999,799999999999999999,809999999999999999,819999999999999999,829999999999999999,839999999999999999,849999999999999999,859999999999999999,869999999999999999,879999999999999999,889999999999999999,899999999999999999,909999999999999999,919999999999999999,929999999999999999,939999999999999999,949999999999999999,959999999999999999,969999999999999999,979999999999999999,989999999999999999,999999999999999999,1009999999999999999,1019999999999999999,1029999999999999999,1039999999999999999,1049999999999999999,1059999999999999999,1069999999999999999,1079999999999999999,1089999999999999999,1099999999999999999,1109999999999999999,1119999999999999999,1129999999999999999,1139999999999999999,1149999999999999999,1159999999999999999,1169999999999999999,1179999999999999999,1189999999999999999,1199999999999999999,1209999999999999999,1219999999999999999,1229999999999999999,1239999999999999999,1249999999999999999,1259999999999999999,1269999999999999999,1279999999999999999,1289999999999999999,1299999999999999999,1309999999999999999,1319999999999999999,1329999999999999999,1339999999999999999,1349999999999999999,1359999999999999999,1369999999999999999,1379999999999999999,1389999999999999999,1399999999999999999,1409999999999999999,1419999999999999999,1429999999999999999,1439999999999999999,1449999999999999999,1459999999999999999,1469999999999999999,1479999999999999999,1489999999999999999,1499999999999999999,1599999999999999999,1699999999999999999,1799999999999999999,1899999999999999999,1999999999999999999,2099999999999999999,2199999999999999999,2299999999999999999,2399999999999999999,2499999999999999999,2599999999999999999,2699999999999999999,2799999999999999999,2899999999999999999,2999999999999999999,3099999999999999999,3199999999999999999,3299999999999999999,3399999999999999999,3499999999999999999,3599999999999999999,3699999999999999999,3799999999999999999,3899999999999999999,3999999999999999999,4099999999999999999,4199999999999999999,4299999999999999999,4399999999999999999,4499999999999999999,4599999999999999999,4699999999999999999,4799999999999999999,4899999999999999999,4999999999999999999,5099999999999999999,5199999999999999999,5299999999999999999,5399999999999999999,5499999999999999999,5599999999999999999,5699999999999999999,5799999999999999999,5899999999999999999,5999999999999999999,6099999999999999999,6199999999999999999,6299999999999999999,6399999999999999999,6499999999999999999,6599999999999999999,6699999999999999999,6799999999999999999,6899999999999999999,6999999999999999999,7099999999999999999,7199999999999999999,7299999999999999999,7399999999999999999,7499999999999999999,7599999999999999999,7699999999999999999,7799999999999999999,7899999999999999999,7999999999999999999,8099999999999999999,8199999999999999999,8299999999999999999,8399999999999999999,8499999999999999999,8599999999999999999,8699999999999999999,8799999999999999999,8899999999999999999,8999999999999999999,9099999999999999999,9199999999999999999]
for i in range(792):
  print(ans[i])

Submission status: Wrong Answer

Solution code:
from fractions import Fraction

def calc(a):
    return sum(map(int, list(str(a))))

def comp(a, b):
    return a * calc(b) <= b * calc(a)

MAX = 10**17
K = input()
A = set()
base = 0
front = 1
ok = True
while base < MAX:
    for i in xrange(1, 999):
        tmp = i * front + base
        if tmp <= MAX:
            A.add(tmp)
    base = base * 10 + 9
    front *= 10

A = sorted(list(A), key=lambda x: -x)
m = A[0]
ans = []

for i in xrange(1, len(A)):
    if comp(A[i], m):
        m = A[i]
        if A[i] <= K:
            ans.append(A[i])

for a in sorted(ans):
    print a

Submission status: Wrong Answer

Solution code:
def s(i):
    return sum([int(k) for k in str(i)])

#for i in range(99,150):
#    print(i, i/s(i))

n = int(input())
if n<=9:
    print(n)
else:
    n-=9
    n*=10
    n+=9
print(n)

Submission status: Wrong Answer

Solution code:



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


# (100o+10x+y)/(o+x+y) > (100o+99)/(o+9+9)
#  100o*18+(10x+y)(o+18) > 100o(x+y) +99(o+x+y)


#
#1 - 10 , 19,29,39,49,59,69,79,89,99

#for i in range(1,1115):
#    print(i,n_snuke(i))


K = int(input())
tmp =0

tmp_list = []
for i in range(K*3):
    tmp = tmp+ 10**(len(str(tmp+1))-1)
    tmp_list.append(tmp)
    #print(tmp,n_snuke(tmp))
r_list = [tmp_list[-1]]
for i in reversed(range(len(tmp_list)-1)):
    if n_snuke(r_list[-1]) >= n_snuke(tmp_list[i]):
        r_list.append(tmp_list[i])

for i in reversed(r_list[-K:]):
    print(i)

Submission status: Wrong Answer

Solution code:



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


# (100o+10x+y)/(o+x+y) > (100o+99)/(o+9+9)
#  100o*18+(10x+y)(o+18) > 100o(x+y) +99(o+x+y)


#
#1 - 10 , 19,29,39,49,59,69,79,89,99

#for i in range(1,1115):
#    print(i,n_snuke(i))


K = int(input())
tmp =0

for i in range(K):
    tmp = tmp+ 10**(len(str(tmp+1))-1)
    print(tmp)

Submission status: Wrong Answer

Solution code:
import sys

k = int(sys.stdin.readline())

n = 0
while n < k:
	print(n%9+1, end="")
	print(n//9*"9")
	n += 1

Submission status: Wrong Answer

Solution code:
import sys

k = int(sys.stdin.readline())

n = 0
while n <= k:
	print(str(n%9+1) + n//9*"9")
	n += 1

Submission status: Wrong Answer

Solution code:
import sys

k = int(sys.stdin.readline())
n = 0
while not k < n:
	print(str((n+1)%10) + n//10*"9")
	n += 1

Submission status: Wrong Answer

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

S = lambda n: sum(map(int, str(n)))
f = lambda N, d: 10**(d+1)*(N//10**(d+1)+1)-1

*r, = range(1, 10)

n = 1; d = 0
while n < 10**15:
    if n >= 10**d*S(n):
        n = n + (9 - (n // 10**d)%10)*10**d
        d += 1
    n += 10**d
    if n < 10**15:
        r.append(n)
p = 10**18; q = 1
ans = []
for v in reversed(r):
    if v*q <= p*S(v):
        p, q = v, S(v)
        ans.append(v)
ans.reverse()
print(*ans[:K], sep='\n')

Submission status: Wrong Answer

Solution code:
K = int(input())
S = lambda n: sum(map(int, str(n)))
F = lambda d: int("".join(map(str, reversed(d))))

ans = []
d = [0]
for i in range(K):
    if d[-1] == 9:
        d.append(1)
    else:
        d[-1] += 1
    v = F(d)
    ans.append(v)
print(*ans, sep='\n')

Submission status: Wrong Answer

Solution code:
def s(n):
    ret=0    
    for i in range(15):
        ret+=(n%10**(i+1))//10**i
    return ret

k=int(input())
ksnk=set()

for i in range(13):
    for j in range(1,1000):
        n=int(str(j)+'9'*i)
        ksnk.add(n)
ksnk=sorted(list(ksnk), reverse=True)

fmin=float('inf')
ans=[]
for a in ksnk:
    fa=a/s(a)    
    if fa<=fmin:
        ans.append(a)
        fmin=fa
ans.reverse()
print(ans[:k])

Submission status: Wrong Answer

Solution code:
k=int(input())
# k=175
# cnt=0
# keta=""
# for i in range(k):
#   cnt+=1
#   if cnt<10:
#     print(int(str(cnt)+keta))
#   else:
#     cnt=1
#     keta=keta+"9"
#     print(int(str(cnt)+keta))

Submission status: Wrong Answer

Solution code:
from fractions import Fraction
from collections import Counter

K = input()
A = range(1, 10) + range(19, 100, 10)
N = K - len(A)
diff = 100
target = 19
count = 0

while N > 0:
    N -= 1
    A.append(A[-1]+diff)
    count += 1
    if count == target:
        diff *= 10
        target += 9
        count = 0

for i in xrange(K):
    print A[i]

Submission status: Wrong Answer

Solution code:
SNK = [1,2,3,4,5,6,7,8,9]
#SNK.append("SUNUKE!:"+str(1))

for i in range(1,10): SNK.append(i*10+9)
#SNK.append("SUNUKE!:"+str(2))

for i in range(1,10): SNK.append(i*100+99)
#SNK.append("SUNUKE!:"+str(3))

LEN = 0
for loop in range(2):
    SNK_sub = list(range(pow(10,loop),pow(10,loop+1)))
    for d in SNK_sub: #loop=0のとき，d=1-9
        LEN += 1+loop
        SNK += [(i*pow(10,LEN+1))+(pow(10,LEN+1)-1) for i in range(10,10*(d+1))]
        SNK += list(map(lambda x:(x*pow(10,LEN+2))+(pow(10,LEN+2)-1),SNK_sub[SNK_sub.index(d)+1:]))
        #SNK.append("SUNUKE!:"+str(LEN+3))

print("\n".join(str(i) for i in SNK[:int(input())]))

Submission status: Wrong Answer

Solution code:
K = int(input())
S = lambda n: sum(map(int,str(n)))
R = lambda n: n/S(n)

arr = []
for i in range(1,100):
    for j in range(1,15):
        arr.append(int(str(i) + '9'*j))

arr.sort(reverse=True)
min_r = arr[0]
snukes = []
for a in arr:
    r = R(a)
    if r < min_r:
        min_r = r
        snukes.append(a)

for i in range(min(9,K)):
    print(i+1)
if K <= 9:
    exit()
K -= 9

print(*snukes[:-K-1:-1],sep='\n')

Submission status: Wrong Answer

Solution code:
def sunuke_sum(arg):
    sum_digit = 0
    for char in arg:
        sum_digit += int(char)
    return sum_digit


input_num = int(input())

sunuke_list = []
min_sunuke_div = 10 ** 100
for d in reversed(range(1, 16)):
    for n in reversed(range(10, 100)):
        i = n * (10 ** d) + (10 ** d - 1)
        sunuke_div = i / sunuke_sum(str(i))
        if min_sunuke_div >= sunuke_div:
            sunuke_list.append(i)
            min_sunuke_div = sunuke_div

for i in reversed(range(1, 101)):
    sunuke_div = i / sunuke_sum(str(i))
    if min_sunuke_div >= sunuke_div:
        sunuke_list.append(i)
        min_sunuke_div = sunuke_div

sunuke_list.reverse()

for i in range(0, input_num):
    print(sunuke_list[i])

Submission status: Wrong Answer

Solution code:
def sunuke_sum(arg):
    sum_digit = 0
    for char in arg:
        sum_digit += int(char)
    return sum_digit


input_num = int(input())

sunuke_list = []
min_sunuke_div = 10 ** 20
for d in reversed(range(1, 16)):
    for n in reversed(range(10, 100)):
        i = n * (10 ** d) + (10 ** d - 1)
        sunuke_div = i / sunuke_sum(str(i))
        if min_sunuke_div >= sunuke_div:
            sunuke_list.append(i)
            min_sunuke_div = sunuke_div

for i in reversed(range(1, 101)):
    sunuke_div = i / sunuke_sum(str(i))
    if min_sunuke_div >= sunuke_div:
        sunuke_list.append(i)
        min_sunuke_div = sunuke_div

sunuke_list.reverse()

for i in range(0, input_num):
    print(sunuke_list[i])

Submission status: Wrong Answer

Solution code:
def sunuke_sum(arg):
    sum_digit = 0
    for char in arg:
        sum_digit += int(char)
    return sum_digit


input_num = int(input())

sunuke_list = []
min_sunuke_div = 10 ** 15
for d in reversed(range(1, 16)):
    for n in reversed(range(10, 100)):
        i = n * (10 ** d) + (10 ** d - 1)
        sunuke_div = i / sunuke_sum(str(i))
        if min_sunuke_div >= sunuke_div:
            sunuke_list.append(i)
            min_sunuke_div = sunuke_div

for i in reversed(range(1, 101)):
    sunuke_div = i / sunuke_sum(str(i))
    if min_sunuke_div >= sunuke_div:
        sunuke_list.append(i)
        min_sunuke_div = sunuke_div

sunuke_list.reverse()

for i in range(0, input_num):
    print(sunuke_list[i])

Submission status: Wrong Answer

Solution code:
def sunuke_sum(arg):
    sum_digit = 0
    for char in arg:
        sum_digit += int(char)
    return sum_digit


input_num = int(input())

sunuke_list = []
min_sunuke_div = 10 ** 15
for d in reversed(range(1, 15)):
    for n in reversed(range(10, 100)):
        i = n * (10 ** d) + (10 ** d - 1)
        sunuke_div = i / sunuke_sum(str(i))
        if min_sunuke_div >= sunuke_div:
            sunuke_list.append(i)
            min_sunuke_div = sunuke_div

for i in reversed(range(1, 101)):
    sunuke_div = i / sunuke_sum(str(i))
    if min_sunuke_div >= sunuke_div:
        sunuke_list.append(i)
        min_sunuke_div = sunuke_div

sunuke_list.reverse()

for i in range(0, input_num):
    print(sunuke_list[i])

Submission status: Wrong Answer

Solution code:
def i1():
 return int(input())
def i2():
 return [int(i) for i in input().split()]
x=[]
k=i1()
for s in range(1,10):
 x.append([s/sum(list(map(int, list(str(s))))),s])

for i in range(1,100):
 for j in range(1,15):
   s=10**j*i+10**j-1
   x.append([s/sum(list(map(int, list(str(s))))),s])

y=sorted(x)
m=0
n=0
for i,j in y:
  if n>k-1:
     break
  if j>10**15:
     break
  if j>m:
     m=j
     print(j)
     n+=1