use proconio::input; fn main() { input! { n:usize, m:usize, } let mut dp = vec![vec![vec![0; n * n + 1]; n + 1]; n + 1]; for i in 0..=n { dp[0][i][0] = 1; } for i in 1..=n { for j in 0..=n { for k in 0..=n * n { if 0 < j { dp[i][j][k] = dp[i][j][k] + dp[i][j - 1][k]; dp[i][j][k] %= m; } if j < i && j <= k { dp[i][j][k] = dp[i][j][k] + dp[i - 1][j][k - j]; dp[i][j][k] %= m; } } } } for i in 0..=n * n { println!("{}", dp[n][n][i]); } }