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 <iostream>
#include <cstdio>
#include <string>
using namespace std;
typedef long long ll;
string a[] = {"","1","2","3","4","5","6","7","8","9","19","29","39","49","59","69","79","89","99","199","299","399","499","599","699","799","899","999","1999","2999","3999","4999","5999","6999","7999","8999","9999","19999","29999","39999","49999","59999","69999","79999","89999","99999","199999","299999","399999","499999","599999","699999","799999","899999","999999","1999999","2999999","3999999","4999999","5999999","6999999","7999999","8999999","9999999","19999999","29999999","39999999","49999999","59999999","69999999","79999999","89999999","99999999","199999999","299999999","399999999","499999999","599999999","699999999","799999999","899999999","999999999","1999999999","2999999999","3999999999","4999999999","5999999999","6999999999","7999999999","8999999999","9999999999","19999999999","29999999999","39999999999","49999999999","59999999999","69999999999","79999999999","89999999999","99999999999","199999999999","299999999999","399999999999","499999999999","599999999999","699999999999","799999999999","899999999999","999999999999","1999999999999","2999999999999","3999999999999","4999999999999","5999999999999","6999999999999","7999999999999","8999999999999","9999999999999","19999999999999","29999999999999","39999999999999","49999999999999","59999999999999","69999999999999","79999999999999","89999999999999","99999999999999","199999999999999","299999999999999","399999999999999","499999999999999","599999999999999","699999999999999","799999999999999","899999999999999","999999999999999"};
int main()
{
    int k;
    scanf("%d",&k);
    k = min(k,135);
    int i = 1;
    for( i = 1; i <= k; i++)
        printf("%s\n",a[i].c_str());
    //printf("%d\n",i);
    return 0;
}