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 <stdlib.h>
#include <math.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>


 long long int max(long long int a ,long long int b){
  if(a<b){
    return b;
  }
  return a;
}

int compare(const void *p0,const void *p1){
  long long int *P0=(long long int*)p0;
  long long int *P1=(long long int*)p1;
  if(*P0>*P1)return 1;
  if(*P0<*P1)return -1;
  return 0;
}


int main(){
  long long int j,i,l,k,p=0,q=0,r=0,a,b,c,d,s=0,h,n,x;
  int e=0;
  scanf("%lld",&k);
  x=k;
  for (int g=1;g<9&&g<=k;g++){
    printf("%d\n",g);
  }
  for (i = 0; i <= k-9; i++) {
    b=i/10;
    c=powl(10,b+1);
    l=i;
    for (j = 16; j >=0 &&l>0; j--) {
      a=powl(10,j);
      if(a<=l){
        s+=l/a;
        e=l/a;
        l-=(l/a)*a;
      }
    }
    a=c*(e+1)-1;
//    printf("%d\n",e);
  printf("%lld\n",a);
  }
/*  l=0;
  while(l<k-9){
    j=10;
    h=j;
    for (i = 16; i >=0 ; i--) {
      a=powl(10,i);
      if(a<=h){
        s+=h/a;
        e=h/a;
        h-=(h/a)*a;
      }
    }
    if (e==9){
      printf("%lld\n",j);
      l++;
    }
    j++;
  }*/
  return 0;
}