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:
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, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999, 19999999999999999, 29999999999999999, 39999999999999999, 49999999999999999, 59999999999999999, 69999999999999999, 79999999999999999, 89999999999999999, 99999999999999999, 199999999999999999, 299999999999999999, 399999999999999999, 499999999999999999, 599999999999999999, 699999999999999999, 799999999999999999, 899999999999999999, 999999999999999999, 1999999999999999999, 2999999999999999999, 3999999999999999999, 4999999999999999999, 5999999999999999999, 6999999999999999999, 7999999999999999999, 8999999999999999999, 9999999999999999999, 19999999999999999999, 29999999999999999999, 39999999999999999999, 49999999999999999999, 59999999999999999999, 69999999999999999999, 79999999999999999999, 89999999999999999999, 99999999999999999999, 199999999999999999999, 299999999999999999999, 399999999999999999999, 499999999999999999999, 599999999999999999999, 699999999999999999999, 799999999999999999999, 899999999999999999999, 999999999999999999999, 1999999999999999999999, 2999999999999999999999, 3999999999999999999999, 4999999999999999999999, 5999999999999999999999, 6999999999999999999999, 7999999999999999999999, 8999999999999999999999, 9999999999999999999999, 19999999999999999999999, 29999999999999999999999, 39999999999999999999999, 49999999999999999999999, 59999999999999999999999, 69999999999999999999999, 79999999999999999999999, 89999999999999999999999, 99999999999999999999999, 199999999999999999999999, 299999999999999999999999, 399999999999999999999999, 499999999999999999999999, 599999999999999999999999, 699999999999999999999999, 799999999999999999999999, 899999999999999999999999, 999999999999999999999999, 1999999999999999999999999, 2999999999999999999999999, 3999999999999999999999999, 4999999999999999999999999, 5999999999999999999999999, 6999999999999999999999999, 7999999999999999999999999, 8999999999999999999999999, 9999999999999999999999999, 19999999999999999999999999, 29999999999999999999999999, 39999999999999999999999999, 49999999999999999999999999, 59999999999999999999999999, 69999999999999999999999999, 79999999999999999999999999, 89999999999999999999999999, 99999999999999999999999999]

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

typedef  long long LL;
const LL mod=1000000007;
#define MAX 10000
#define NIL -1
const double PI  = acos(-1.0);
const int INF = 1e9 + 7;
//-------------------------------------------


LL k;
long long ans[mod];

int main(){

    cin.tie(0);
    ios::sync_with_stdio(false);




    cin >> k;

    LL iter = 1;
    ans[0] = 0;

    for( int i = 1 ; i <= k ; i++){

        ans[i] = iter + ans[i-1];

        cout << ans[i] << endl;

        if(i % 9 == 0 ){
            iter *= 10;
        }

    }

    return 0;
}

Submission status: Runtime Error

Solution code:
# https://beta.atcoder.jp/contests/abc101/tasks/arc099_b
# D - Snuke Numbers

# D_Snuke_Numbers.py

K = int(input())


c = 0
while c != K:
    for i in range(M):
        str_i = str(i)
        keta = len(str_i) -1
        for n in range(1, 10):
            if i == 10 ** (keta -1):
                print(i)
                c += 1

Submission status: Runtime Error

Solution code:
def SUNUKE(i):
    x=str(i)
    SUM=0

    for j in range(len(x)):
        SUM+=int(x[j])

    return SUM,i/SUM

SUNUKESUU=[0,1,2,3,4,5,6,7,8,9]
i=10
keta=0

while i<10**5:


    if SUNUKE(i)[1]>=10**keta:
        i-=10**keta
        keta+=1
        
    else:
        if SUNUKESUU[-1]!=i:
            SUNUKESUU+=[i]
        i+=10**keta
    

for i in range(1,int(input())+1):
    print(SUNUKESUU[i])

Submission status: Runtime Error

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, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999, 19999999999999999, 29999999999999999, 39999999999999999, 49999999999999999, 59999999999999999, 69999999999999999, 79999999999999999, 89999999999999999, 99999999999999999, 199999999999999999, 299999999999999999, 399999999999999999, 499999999999999999, 599999999999999999, 699999999999999999, 799999999999999999, 899999999999999999, 999999999999999999, 1999999999999999999, 2999999999999999999, 3999999999999999999, 4999999999999999999, 5999999999999999999, 6999999999999999999, 7999999999999999999, 8999999999999999999, 9999999999999999999]
for i in range(int(input())):
    print(ans[i])

Submission status: Runtime Error

Solution code:
SNK = [1,2,3,4,5,6,7,8,9] #1桁目

for i in range(1,10): SNK.append((i*10)+9) #2桁目
for i in range(1,10): SNK.append((i*100)+99) #3桁目

for j in range(9): #4-12桁目
    SNK_sub = [19,29,39,49,59,69,79,89,99]
    SNK_sub = list(map(lambda x:(x*pow(10,2+j))+(pow(10,2+j)-1),SNK_sub))
    for i in range(10,20+(10*j)):
        SNK.append(i*pow(10,2+j)+(pow(10,2+j)-1))
    SNK += SNK_sub[j+1:]
    
for j in range(3): #13,14桁目
    for i in range(10,100):
        SNK.append(i*pow(10,10+j)+(pow(10,10+j)-1))

K = int(input())

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

Submission status: Runtime Error

Solution code:
k = int(input())
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
    memo = 1
    for i in range(19,10000000000,10):
        if i / digsums(i) < (i+100)/digsums(i+100) and i / digsums(i) < (i+10)/digsums(i+10) and memo < (i/digsums(i)) :
            memo = (i/digsums(i))
            counter +=1
        if counter == max_count:
            break

Submission status: Runtime Error

Solution code:
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, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999, 19999999999999999, 29999999999999999, 39999999999999999, 49999999999999999, 59999999999999999, 69999999999999999, 79999999999999999, 89999999999999999, 99999999999999999, 199999999999999999, 299999999999999999, 399999999999999999, 499999999999999999, 599999999999999999, 699999999999999999, 799999999999999999, 899999999999999999, 999999999999999999, 1999999999999999999, 2999999999999999999, 3999999999999999999, 4999999999999999999, 5999999999999999999, 6999999999999999999, 7999999999999999999, 8999999999999999999, 9999999999999999999, 19999999999999999999, 29999999999999999999, 39999999999999999999, 49999999999999999999, 59999999999999999999, 69999999999999999999, 79999999999999999999, 89999999999999999999, 99999999999999999999, 199999999999999999999, 299999999999999999999, 399999999999999999999, 499999999999999999999, 599999999999999999999, 699999999999999999999, 799999999999999999999, 899999999999999999999, 999999999999999999999, 1999999999999999999999, 2999999999999999999999, 3999999999999999999999, 4999999999999999999999, 5999999999999999999999, 6999999999999999999999, 7999999999999999999999, 8999999999999999999999, 9999999999999999999999, 19999999999999999999999, 29999999999999999999999]
for i in range(k):
    print(a[i])

Submission status: Runtime Error

Solution code:
SNK = [1,2,3,4,5,6,7,8,9] #1桁目

for i in range(1,10): SNK.append((i*10)+9) #2桁目
for i in range(1,10): SNK.append((i*100)+99) #3桁目

for j in range(9): #4-12桁目
    SNK_sub = [19,29,39,49,59,69,79,89,99]
    SNK_sub = list(map(lambda x:(x*pow(10,2+j))+(pow(10,2+j)-1),SNK_sub))
    for i in range(10,20+(10*j)):
        SNK.append(i*pow(10,2+j)+(pow(10,2+j)-1))
    SNK += SNK_sub[j+1:]
    
for j in range(2): #13,14桁目
    for i in range(10,100):
        SNK.append(i*pow(10,10+j)+(pow(10,10+j)-1))

K = int(input())

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

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)])
        if len(snuke_nums) >= k:
            break

    num = len(snuke_nums)
    snuke_sn = [0 for i in range(num)]
    for i in range(num):
        tmp = snuke_nums[i]
        sn = 0
        while tmp:
            sn += tmp % 10
            tmp //= 10
        snuke_sn[i] = snuke_nums[i] / sn

    snuke_sn_sort = sorted(snuke_sn)

    snuke_flag = [False for i in range(num)]
    for i in range(num):
        if snuke_sn[i] != snuke_sn_sort[i]:
            snuke_flag[i] = True

    snuke_ans = []
    for i in range(num):
        if not snuke_flag[i]:
            snuke_ans.append(snuke_nums[i])

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


abc101_d()

Submission status: Runtime Error

Solution code:
list1=[]
for i in range(1,200):
    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)
    elif i<=169:
        a=(i-160)*10000000000000000+9999999999999999
        list1.append(a)
    elif i<=179:
        a=(i-170)*100000000000000000+99999999999999999
        list1.append(a)
#print(list1[143])
K=int(input())
for j in range(K):
    print(list1[j])

Submission status: Runtime Error

Solution code:
K = input()


def Sn(N1):
    Sn = 0
    N = str(N1)
    for i in range(len(N)):
        Sn = Sn + int(N[i])

    return Sn

R = []
for i in range(1,2000):
    X = 0
    for j in range(i,1000):
        if(i/Sn(i) <= j/Sn(j)):
            X = X + 1

        if (X ==  1000 - i ):
            R.append(i)


for i in range(0,int(K)):
    print(R[i])

Submission status: Runtime Error

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, 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]
k = int(input())
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(15):
        snuke_nums.extend([n * (10 ** i) - 1 for n in range(2, 11)])
        if len(snuke_nums) >= k:
            break

    num = len(snuke_nums)
    snuke_sn = [0 for _ in range(num)]
    for i in range(num):
        tmp = snuke_nums[i]
        sn = 0
        while tmp:
            sn += tmp % 10
            tmp //= 10
        snuke_sn[i] = snuke_nums[i] / sn

    snuke_sn_sort = sorted(snuke_sn)

    snuke_flag = [False for _ in range(num)]
    for i in range(num):
        if snuke_sn[i] != snuke_sn_sort[i]:
            snuke_flag[i] = True

    snuke_ans = []
    for i in range(num):
        if not snuke_flag[i]:
            snuke_ans.append(snuke_nums[i])

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


abc101_d()

Submission status: Runtime Error

Solution code:
k = int(input())
l = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 19,
29,
39,
49,
59,
69,
79,
89,
99,
199,
299,
399,
499,
599,
699,
799,
899,
999,
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,
30999,
40999,
50999,
60999,
70999,
80999,
90999,
100999,
110999,
120999,
130999,
140999,
150999,
160999,
170999,
180999,
190999,
200999,
210999,
220999,
230999,
240999,
250999,
260999,
270999,
280999,
290999,
300999,
400999,
500999,
600999,
700999,
800999,
900999,
1000999,
1100999,
1200999,
1300999,
1400999,
1500999,
1600999,
1700999,
1800999,
1900999,
2000999,
2100999,
2200999,
2300999,
2400999,
2500999,
2600999,
2700999,
2800999,
2900999,
3000999,
4000999,
5000999,
6000999,
7000999,
8000999,
9000999,
10000999,
11000999,
12000999,
13000999,
14000999,
15000999,
16000999,
17000999,
18000999,
19000999,
20000999,
21000999,
22000999,
23000999,
24000999,
25000999,
26000999,
27000999,
28000999,
29000999,
30000999,
40000999,
50000999]
     
for i in range(k):
     print(l[i])

Submission status: Runtime Error

Solution code:
k = int(input())
a = [1,2,3,4,5,6,7,8,9,19,29,39,49,59,69,79,89,99,100,200,300,400,500,600,700,800,900]
while n < k:
    print(a[n])
    n += 1

Submission status: Runtime Error

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

k = int(input())

targets = []
for i in range(1, 10**4*6.5):
    targets.append(i/sum(list(map(int, list(str(i))))))

min_list = [10**10]
for target in reversed(targets):
    min_list.insert(0, min([min_list[0], target]))

i = 0
count = 1
while count <= k:
    if targets[i] <= min_list[i]:
        print(i+1)
        count += 1
    i += 1

Submission status: Runtime Error

Solution code:
K = int(input())

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



i, n, n_len= 0, 0, 1
while i < K:
    n += 1
    if n / sunuke(n) <= ((n+1)/ sunuke(n+1)):
        if str(n)[-1] == "9":
                print(n)
                i += 1
                new_n = ""
                for x in range(n_len):
                    new_n = new_n + "0"
                n_len += 1
                new_n = "1" + new_n
                n = int(new_n)
        else:
            print(n)
            i += 1

Submission status: Runtime Error

Solution code:
K = int(input())

def make(keta):
    num = '9' * (keta - 1)
    ls = []
    for i in range(1,10):
        s = str(i) + num
        ls.append(s)
        
    return ls
  
ls = []
for i in range(1,K//9 + 1):
    ls += make(i)

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

Submission status: Runtime Error

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

k = int(input())

targets = []
for i in range(1, 10**4*5):
    targets.append(i/sum(list(map(int, list(str(i))))))

min_list = [10**10]
for target in reversed(targets):
    min_list.insert(0, min([min_list[0], target]))

i = 0
count = 1
while count <= k:
    if targets[i] <= min_list[i]:
        print(i+1)
        count += 1
    i += 1

Submission status: Runtime Error

Solution code:
K = input()


def Sn(N1):
    Sn = 0
    N = str(N1)
    for i in range(len(N)):
        Sn = Sn + int(N[i])

    return Sn

R = []
for i in range(1,1000):
    X = 0
    for j in range(i,1000):
        if(i/Sn(i) <= j/Sn(j)):
            X = X + 1

        if (X ==  1000 - i ):
            R.append(i)


for i in range(0,int(K)):
    print(R[i])

Submission status: Runtime Error

Solution code:
K = int(input())

def make(keta):
    num = '9' * (keta - 1)
    ls = []
    for i in range(1,10):
        s = str(i) + num
        ls.append(s)
        
    return ls
  
ls = []
for i in range(1,16):
    ls += make(i)

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

Submission status: Runtime Error

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, 1999, 2999, 3999, 4999, 5999, 6999, 7999, 8999, 9999, 19999, 29999, 39999, 49999, 59999, 69999, 79999, 89999, 99999, 199999, 299999, 399999, 499999, 599999, 699999, 799999, 899999, 999999, 1999999, 2999999, 3999999, 4999999, 5999999, 6999999, 7999999, 8999999, 9999999, 19999999, 29999999, 39999999, 49999999, 59999999, 69999999, 79999999, 89999999, 99999999, 199999999, 299999999, 399999999, 499999999, 599999999, 699999999, 799999999, 899999999, 999999999, 1999999999, 2999999999, 3999999999, 4999999999, 5999999999, 6999999999, 7999999999, 8999999999, 9999999999, 19999999999, 29999999999, 39999999999, 49999999999, 59999999999, 69999999999, 79999999999, 89999999999, 99999999999, 199999999999, 299999999999, 399999999999, 499999999999, 599999999999, 699999999999, 799999999999, 899999999999, 999999999999, 1999999999999, 2999999999999, 3999999999999, 4999999999999, 5999999999999, 6999999999999, 7999999999999, 8999999999999, 9999999999999, 19999999999999, 29999999999999, 39999999999999, 49999999999999, 59999999999999, 69999999999999, 79999999999999, 89999999999999, 99999999999999, 199999999999999, 299999999999999, 399999999999999, 499999999999999, 599999999999999, 699999999999999, 799999999999999, 899999999999999, 999999999999999, 1999999999999999, 2999999999999999, 3999999999999999, 4999999999999999, 5999999999999999, 6999999999999999, 7999999999999999, 8999999999999999, 9999999999999999]
for i in range(int(input())):
    print(ans[i])

Submission status: Runtime Error

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

k = int(input())

targets = []
for i in range(1, 10**4):
    targets.append(i/sum(list(map(int, list(str(i))))))

min_list = [10**10]
for target in reversed(targets):
    min_list.insert(0, min([min_list[0], target]))

i = 0
count = 1
while count <= k:
    if targets[i] <= min_list[i]:
        print(i+1)
        count += 1
    i += 1

Submission status: Runtime Error

Solution code:
k = int(input())
l = [1, 2, 3, 4, 5, 6, 7, 8, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, 199, 299, 399, 499, 599, 699, 799, 899, 999, 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, 30999, 40999, 50999, 60999, 70999, 80999, 90999, 100999, 110999, 120999, 130999, 140999, 150999, 160999, 170999, 180999, 190999, 200999, 210999, 220999, 230999, 240999, 250999, 260999, 270999, 280999, 290999, 300999, 400999, 500999, 600999, 700999, 800999, 900999, 1000999, 1100999, 1200999, 1300999, 1400999, 1500999, 1600999, 1700999, 1800999, 1900999, 2000999, 2100999, 2200999, 2300999, 2400999, 2500999, 2600999, 2700999, 2800999, 2900999, 3000999, 4000999, 5000999, 6000999, 7000999, 8000999, 9000999, 10000999, 11000999, 12000999, 13000999, 14000999, 15000999, 16000999, 17000999, 18000999, 19000999, 20000999, 21000999, 22000999, 23000999, 24000999, 25000999, 26000999, 27000999, 28000999, 29000999, 30000999, 40000999, 50000999, 60000999, 70000999, 80000999, 90000999]
for i in range(k):
    print(l[i])

Submission status: Runtime Error

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, 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]
for i in range(int(input())):
    print(ans[i])