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: Accepted)

#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include<fstream>

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
using namespace std;

const LL MOD = 1000000007;// 10^9+7
const int INF = (1 << 30);


//変数


double S(LL x) {
	double res = 0;
	while (x) {
		res += x % 10;
		x /= 10;
	}
	return res;
}
double f(LL x) {
	double res = x;
	res /= S(x);
	return res;
}




//サブ関数
//入力
void input()
{

}


//計算
void calc()
{


}


//出力
void output()
{

}


//デバッグ
void debug()
{
	int K;
	cin >> K;
	set<LL> data;
	vector<LL> res;

	int siz = 0;
	REP(siz,12){
		string post = "";
		REP(i, siz)post += to_string(9);
		FOR(i, 1, 10000) {
			string res = post;
			res += to_string(i);
			reverse(res.begin(), res.end());
			data.insert(stoll(res));
		}
	}
	for (auto num : data) {
		res.push_back(num);
	}
	sort(res.begin(), res.end());

	//REP(i, K)cout << res[i] << endl;

start:;
	vector<bool> banish(res.size(), false);
	REP(i, res.size())FOR(j, i+1, res.size()) {
		if (f(res[i]) > f(res[j])) {
			banish[i] = true;
			break;
		}
	}
	for (int i = banish.size() - 1; i >= 0; i--) {
		if (banish[i]) {
			res.erase(res.begin() + i);
		}
	}

	//cout << siz << endl;
	//for (auto num : data)cout << num << endl;
	REP(i, K)cout << res[i] << endl;
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	input();
	calc();
	output();
	debug();
	
	return 0;
}