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 <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"
#define fcout cout << fixed << setprecision(18)

#define MOD 1000000007 // 1e9+7
#define PI 3.1415926535
/*
3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679
*/
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1
#define LINF 1000000000000000001 // 1e18+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------
// ll func(ll n, int a) {
//     int res = 0;
//     while (n > 0) {
//         res += n%a;
//         n /= a;
//     }
//     return res;
// }

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  ll k;cin>>k;
  // for(ll i=1;i<=k;i++){
  //   cout<<i<<" "<<func(i,10)<<" "<<(float)i/func(i,10)<<"\n";
  // }
  vector<ll> vec;
  ll a[9] = {2,3,4,5,6,7,8,9,10};
  for(ll i=0;i<16;i++){
    for(auto j:a){
      vec.push_back(j*pow(10, i) - 1);
    }
  }
  for(ll i=0;i<k;i++){
    if(vec[i]%2==0 && vec[i]>10)vec[i]++;
    P(vec[i]);
  }
  return 0;
}