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 SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define read() 	        freopen("in.txt","r",stdin)
#define write()         freopen("out.txt","w",stdout)
#define sf(n) 	        scanf("%d",&n)
#define sfd(n)          scanf("%lf",&n)
#define sl(x)           scanf("%I64d",&x)
#define sfl(n) 	        scanf("%lld", &n)
#define sfc(n)          scanf(" %c",&n)
#define sful(n)         scanf("%ull",&n)
#define ull             unsigned long long int
#define endll           pf("\n")
#define pf              printf
#define pi              acos(-1.0)
#define eps 	        1e-18
#define mem(a,b)        memset(a,b,sizeof(a))
#define pb              push_back
#define xx              first
#define yy              second
#define pii             pair<int, int>
#define pll             pair<ll, ll>
#define MP make_pair
#define ll              long long
#define uniq(a)      a.erase(unique(a.begin(), a.end()), a.end())
#define cnd tree[idx]
#define lnd tree[idx<<1]
#define rnd tree[(idx<<1)+1]
#define lndp (idx<<1),(b),((b+e)>>1)
#define rndp ((idx<<1)+1),(((b+e)>>1)+1),(e)
#define inf 1999999999
#define MX 100005
#define mod 107
#define var    int i,j,k,n,m,z=0,c=0,t,x,y,l,r,mid
bool Check(ll  N,int pos){return (bool)(N & (1LL<<pos));}
ll  Set(ll  N,int pos){	return N=N | (1LL<<pos);}
//int dx[8]={0,0,1,1,-1,-1,1,-1};  //8 direction
//int dy[8]={1,-1,1,-1,1,-1,0,0};
//int dx[4]={1,-1,0,0};  //4 direction
//int dy[4]={0,0,1,-1};
ll a[10000005];
int main()
{
    ll var;
    cin>>n;l=0;
    for(i=1;i<=100000;i++)
    {
        x=i;c=0;
        while(x>0)
        {
            c+=x%10;
            x/=10;
        }
        z=(i)/c;
        for(j=i+1;j<=i+10;j++)
        {
            x=j;c=0;
            while(x>0)
            {
                c+=x%10;
                x/=10;
            }
            if((j)/c<z)
            {
                z=0;
            }
        }
        if(z>0)a[l++]=i;
    }
    x=min(l,n);
    for(i=0;i<x;i++)
    {
        pf("%lld\n",a[i]);
    }
    n-=x;
    x--;
    x=a[x]+100;
    for(i=0;i<n;i++)
    {
        cout<<x<<endl;
        x+=100;
    }
}