const MOD: usize = 1e9 as usize + 7; fn power(base: usize, times: usize) -> usize { if times == 0 { return 1usize; } if times == 1 { return base; } let temp = power(base, times/2); temp * temp % MOD * power(base, times%2) % MOD } fn main() { let mut nm = String::new(); std::io::stdin().read_line(&mut nm).ok(); let nm: Vec = nm.trim().split_whitespace().map(|s| s.parse().unwrap()).collect(); let n = nm[0]; let m = nm[1]; println!("{}", n); for i in 2..=m { let base = (n+1) / i; if base == 1 { println!("0"); continue; } let rest = (n+1) % i; let result = (base - 1) * power(base+1, rest) % MOD * power(base, i-rest-1) % MOD; println!("{}", result); } }