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# (Mono 4.6.2.0) (judge verdict: Time Limit Exceeded)

using System;

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            int a;
            a = int.Parse(Console.ReadLine());
            int[] b = new int[a];
            int count = 0;
            for(int i = 1;i < int.MaxValue; i++)
            {
                if (count ==  a) continue;
                if (Checks(i))
                {
                    b[count] = i;
                    count++;
                }
            }
            for(int i = 0; i < a; i++)
            {
                Console.WriteLine(b[i]);
            }

        }
        public static bool Checks(decimal a)
        {
            decimal b = Sumsum(a.ToString());
            decimal c = Sumsum((a+1).ToString());
            decimal d = Sumsum((a + 9999).ToString());
            for(int i = 0;i < 1000; i++)
            {
                decimal g = Sumsum((a + i).ToString());
                if ((a / b) > (a + i) / g) return false;
            }
            //Console.WriteLine(a + " " + b + " " + (a / b) + " " + ((a + 1) / c) + " " + Ifif((a / b) , ((a + 1) / c)));
            if ((a / b) <= ((a + 1m) / c) && (a / b) <= ((a + 9999m) / d)) return true;
            else return false;
        }
        
        public static string Ifif(decimal a, decimal b)
        {
            if (a < b) return "true";
            else return "flase";

        }

        public static int Sumsum(string a)
        {
            int aa = 0;
            for (int i = 0; i < a.Length; i++)
            {
               aa += int.Parse(a[i].ToString());
            }

            return aa;
        }
    }
}