#include using namespace std; typedef long long ll; typedef long double ld; #define REP(i, n) for (int i = 0; i < (n); ++i) #define REPR(i, n) for (int i = n - 1; i >= 0; --i) #define FOR(i, m, n) for (int i = m; i < n; ++i) #define FORR(i, m, n) for (int i = m; i >= n; --i) #define ALL(v) (v).begin(),(v).end() templatebool chmax(T &a, const T &b) { if (abool chmin(T &a, const T &b) { if (b> n >> m; vector dp(n*n+1,vector(2*n+1,0LL)); dp[0][0]=1; REP(i,2*n){ vector tmp(n*n+1,vector(2*n+1,0LL)); REP(j,n*n+1){ REP(k,i/2+1){ if(dp[j][k]==0) continue; (tmp[j+k][k]+=dp[j][k])%=m; (tmp[j][k+1]+=dp[j][k])%=m; } } swap(tmp,dp); } REP(i,n*n+1){ cout << dp[i][n] << endl; } }