#![allow(unused_imports)] use std::cmp::*; use std::collections::*; use std::io::Write; use std::ops::Bound::*; #[allow(unused_macros)] macro_rules! debug { ($($e:expr),*) => { #[cfg(debug_assertions)] $({ let (e, mut err) = (stringify!($e), std::io::stderr()); writeln!(err, "{} = {:?}", e, $e).unwrap() })* }; } fn main() { let v = read_vec::(); let (n, m) = (v[0], v[1]); println!("{}", n); for x in 2..m + 1 { let mut n = n; if n <= x { println!("0"); continue; } n -= x; let min_n = n / x; let mid_n = min_n + 1; let max_n = min_n + 2; let res = n % x; let ans; // debug!(n, res); if res == x - 1 { ans = mid_n * pow(max_n, res); } else { ans = min_n * pow(max_n, res + 1) * pow(mid_n, x - (res - 2)); } println!("{}", ans); } } fn read() -> T { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().parse().ok().unwrap() } fn read_vec() -> Vec { read::() .split_whitespace() .map(|e| e.parse().ok().unwrap()) .collect() } fn pow(n: i64, mut p: i64) -> i64 { let mut r = n; let mut ret = 1; while p > 0 { if p % 2 == 0 { r = r * r; p /= 2; } else { ret = ret * r; p -= 1; } } ret }