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

Solution in C++14 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
//#define EACH(i, c) for (auto &(i): c)
#define all(c) begin(c),end(c)
//#define EXIST(s, e) ((s).find(e)!=(s).end())
//#define SORT(c) sort(begin(c),end(c))
//#define pb emplace_back
//#define MP make_pair
//#define SZ(a) int((a).size())

//#define LOCAL 0
//#ifdef LOCAL
//#define DEBUG(s) cout << (s) << endl
//#define dump(x)  cerr << #x << " = " << (x) << endl
//#define BR cout << endl;
//#else
//#define DEBUG(s) do{}while(0)
//#define dump(x) do{}while(0)
//#define BR
//#endif


//改造
typedef long long int ll;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define eps 1e-15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007
//ここから編集する

ll snuke(ll n) {
    ll ret = 0;
    while (n > 0) {
        ret += n % 10;
        n /= 10;
    }
    return ret;
}

void solve() {
    int K;
    cin >> K;

    int cnt = 0;

//    vector<ll> umekomi({19,199,1099,10999,109999,109999});
    vector<ll> umekomi({19, 199});

    for (int i = 3; i < 17; i++) {
        ll add = (long) round(1.1 * pow(10, i)) - 1ll;
        umekomi.push_back(add);
    }
    vector<double> minione;
    for (ll e : umekomi) {
        double chi = 1.0 * e;
        double mot = 1.0 * snuke(e);
        minione.push_back(chi / mot);
    }

    while (K--) {
        cnt++;
        if (cnt < 10) {
            cout << cnt << endl;
            K--;
        } else {
            int cur = upper_bound(all(umekomi), cnt) - umekomi.begin();
            if (cnt < minione[cur]) {
                cout << cnt << endl;
            }
        }
    }

}

void solve2(){
    int K;
    cin >> K;

    int keta = 0;
    int top = 1;
    while(K--){
        ll res = round(pow(10,keta)) - 1ll;
        res += round(pow(10,keta) * top);

        top++;
        if(top > 9){
            top = 1;
            keta++;
        }

        cout << res << endl;
    }
}

void guchoku() {
    int K;
    cin >> K;

    int cnt = 0;
    ll max_chi = 1ll;
    ll max_mot = 1ll;
    while (K--) {
        cnt++;
        ll chi = cnt;
        ll mot = snuke(cnt);
        if (chi * max_mot < max_chi * mot) {
            //成立すれば最小値
        }
    }
}

void jikken() {

//    for(int i = 1; i < 10000; i++){
//        double res = 1.0 * i / snuke(i);
//        cout << i << " : " << res << endl;
//    }

    for (int i = 1; i < 10000; i++) {
        double res = 1.0 * i / snuke(i);
        if (res < 15)
            cout << i << " : " << res << endl;
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);

    solve2();
//    jikken();


    return 0;
}