pub mod procon_input { use std::{str::FromStr, iter::FromIterator}; pub fn read_line() -> String { let mut input = String::new(); std::io::stdin().read_line(&mut input).ok(); input } pub fn parse(s: &str) -> T { s.parse().ok().unwrap() } pub fn read() -> T { parse(read_line().trim_end()) } pub fn read_collection>() -> C { read_line().split_whitespace().map(parse).collect() } #[macro_export] macro_rules! read_tuple { ( $( $t:ty ),* ) => {{ let input = read_line(); let mut iter = input.split_whitespace(); ( $( parse::<$t>(iter.next().unwrap()) ),* ) }}; } } use procon_input::*; const MOD: i64 = 1_000_000_007; fn solve(writer: &mut std::io::BufWriter) { use std::io::Write; let (n, m) = read_tuple!(i64, i64); let pow = |mut a: i64, mut n: i64| -> i64 { let mut res = 1; while n > 0 { if n & 1 > 0 { res = res * a % MOD; } a = a * a % MOD; n >>= 1; } res }; for x in 1..=m { let q = n / x; let r = n % x; let ans = { if x - r == 1 { pow(q + 1, r) * q % MOD } else { pow(q + 1, r + 1) * pow(q, x - r - 2) % MOD * (q - 1) % MOD } }; writeln!(writer, "{}", ans).ok(); } } fn main() { let stdout = std::io::stdout(); let mut writer = std::io::BufWriter::new(stdout.lock()); solve(&mut writer); }