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 Rust (1.15.1) (judge verdict: Wrong Answer)

use std::cmp;
// use std::collections::HashMap;
// use std::collections::HashSet;
// use std::collections::VecDeque;
use std::collections::BTreeMap;


// const INF: i64 = 1_000_000_000;

const MOD: i64 = 1_000_000_009;


fn s(n: i64) -> i64 {
    match n {
        0 => 0,
        m => m%10 + s(m/10)
    }
}

fn g(n: i64) -> f64 {
    n as f64 / ((s(n)) as f64)
}


fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin);

    let k: usize = sc.read();

    /*
    let mut ansvec = vec![];
    let mut pow: i64 = 1;
    for e in 0..16 {
        for i in 1..10 {
            ansvec.push(i * pow + pow - 1);
        }
        pow *= 10;
    }
    */

    for i in 0..(cmp::min(k,9)) {
        println!("{}", i+1);
    }

    let mut x: i64 = 10;
    let mut pow: i64 = 1;

    for i in 9..k {
        println!("{}", x);
        loop {
            let y = x + pow;
            if x < pow * 10 && y >= pow * 10 {
                x = pow * 10;
                pow = 1;
                continue;
            }
            if g(y) < g(x) {
                x = y;
                break;
            }
            pow *= 10;
        }
    }
}

// thanks, ir5
use std::io::{stdin, Read, StdinLock};
use std::str::FromStr;

struct Scanner<'a> {
    cin: StdinLock<'a>,
}

impl<'a> Scanner<'a> {
    fn new(cin: StdinLock<'a>) -> Scanner<'a> {
        Scanner { cin: cin }
    }

    fn read1<T: FromStr>(&mut self) -> Option<T> {
        let token = self.cin
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        token.parse::<T>().ok()
    }

    fn read<T: FromStr>(&mut self) -> T {
        self.read1().unwrap()
    }
}