Problem:


Score : 500 points

Problem Statement

Let S(n) denote the sum of the digits in the decimal notation of n.
For example, S(123) = 1 + 2 + 3 = 6.

We will call an integer n a Snuke number when, for all positive integers m such that m > n, \frac{n}{S(n)} \leq \frac{m}{S(m)} holds.

Given an integer K, list the K smallest Snuke numbers.

Constraints

1 \leq K

The K-th smallest Snuke number is not greater than 10^{15}.

Input

Input is given from Standard Input in the following format:

K

Output

Print K lines. The i-th line should contain the i-th smallest Snuke number.

Sample Input 1

10

Sample Output 1

1
2
3
4
5
6
7
8
9
19



Sample input:
10


Sample output:
1
2
3
4
5
6
7
8
9
19

Submission status: Runtime Error

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

Submission status: Runtime Error

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

for i in range(int(input())):
    print(sunu[i])

Submission status: Runtime Error

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

for i in range(int(input())):
    print(sunu[i])

Submission status: Runtime Error

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

for i in range(int(input())):
    print(sunu[i])

Submission status: Runtime Error

Solution code:
li=[ 1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 28, 29, 37, 38, 39, 46, 47, 48, 49, 55, 56, 57, 58, 59, 64, 65, 66, 67, 68, 69, 73, 74, 75, 76, 77, 78, 79, 82, 83, 84, 85, 86, 87, 88, 89, 91, 92, 93, 94, 95, 96, 97, 98, 99, 191, 192, 193, 194, 195, 196, 197, 198, 199, 282]
k=int(input())
count=0
i=0
while(count!=k):
    print(li[i])
    i=i+1
    count=count+1

Submission status: Runtime Error

Solution code:
k = int(input())
snuke_nums = []

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

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

Submission status: Runtime Error

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

k_input = int(input())

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

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

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

Submission status: Runtime Error

Solution code:
k = int(input())
ans = []
for i in range(0, 19):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    if ans[i] > 10 ** 15
        break
    print(ans[i])

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())
    snuke_nums = []

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

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


abc101_d()

Submission status: Runtime Error

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

k_input = int(input())

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

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

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

Submission status: Runtime Error

Solution code:
k = int(input())
ans = []
for i in range(0, 18):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    print(ans[i])

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())
    snuke_nums = []

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

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


abc101_d()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
k = int(input())
ans = []
for i in range(0, 17):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    print(ans[i])

Submission status: Runtime Error

Solution code:
k = int(input())
ans = []
for i in range(0, 16):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    print(ans[i])

Submission status: Runtime Error

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

Solution code:
def abc101_d():
    k = int(input())
    snuke_nums = []

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

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


abc101_d()

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())
    snuke_nums = []

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

    for i in range(k):
        print(snuke_nums[i])
    return 0


abc101_d()

Submission status: Runtime Error

Solution code:
def abc101_d():
    k = int(input())
    snuke_nums = []

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

    for i in range(k):
        print(snuke_nums[i])
    return 0


abc101_d()

Submission status: Runtime Error

Solution code:
k = int(input())
ans = []
for i in range(0, 15):
    for j in range(10**i, 10**(i+1), 10**i):
        ans.append(j-1)
ans = ans[1:]
for i in range(k):
    print(ans[i])

Submission status: Runtime Error

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

k = int(input())

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

while int(n) <= 10**17:
    for i in range(1, 10):
        ans.append(int(str(i) + n))
    n += '9'

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

Submission status: Runtime Error

Solution code:
import math
n,k=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
	if a[i]==1:
		break
p=i
k-=1

#print(ans)
x=0
for j in range(n-1,p,-k):
	x+=1
#print(x)
for j in range(0,p,k):
	x+=1
y=p%k+1+(n-p-1)%k
if p%k>0 and (n-p-1)%k>0 and y<=k+1:
	x-=1
print(x)

Submission status: Runtime Error

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

k = int(input())

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

while int(n) <= 10**15:
    for i in range(1, 10):
        ans.append(int(str(i) + n))
    n += '9'

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