#![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]); let mut coefs = vec![HashMap::new(); m * 3 + 1]; for a in 0..=m { for b in 0..=m { for c in 0..=m { if a + b + c > 400 { break; } let k = a * a + b * b + c * c + a * c + b * c + b * a; *coefs[a + b + c].entry(k).or_insert(0) += 1; } } } // debug!(coefs); let mut answers = vec![0; 10 * n + 1]; for coef in 0..=min(3 * m, 400) { for d in 0..=m { let k1 = d * d + coef * d; if k1 > n { break; } for (&k2, &v) in &coefs[coef] { answers[k1 + k2] += v; } } } for ans in answers.into_iter().take(n + 1) { 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() }