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 (GCC 5.4.1) (judge verdict: Wrong Answer)

#include <stdio.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)((n>>m)&1)

int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}


ll f(ll n){
	ll t=0;
	while(n){
		t+=n%10;
		n/=10;
	}
	return t;
}

ll a[]={11,12,13,14,15,16,17,18,19,29,39,49,59,69,79,89,99};
ll n;
int main(){
	scanf("%lld",&n);
	if(n<=9){
		rep(i,1,n+1)printf("%lld\n",i);
		return 0;
	}
	rep(i,1,10)printf("%lld\n",i);
	n-=9;

	if(n<=9){
		rep(i,1,n+1)printf("%lld\n",i*10+9);
		return 0;
	}
	rep(i,1,10)printf("%lld\n",i*10+9);
	n-=9;

	ll s=100;
	ll i=0;
	while(n--){
		ll k=a[i%17]*s+s-1;
//		printf("%f %lld\n",1.0*k/f(k),k);
		printf("%lld\n",k);
		i++;
		if(i==17){
			i=0;
			s*=10;
		}
	}
  return 0;
}