/** * author: Sooh * created: 03.09.2021 22:07:42 **/ #include using namespace std; #if __has_include() #include using namespace atcoder; //using mint = modint998244353; //using mint = modint1000000007; #endif #pragma region template using ll = long long; template using V = vector; #define rep(i,n) for(int i=0;i void view(T e){std::cerr << e << std::endl;} template void view(const std::vector& v){for(const auto& e : v){ std::cerr << e << " "; } std::cerr << std::endl;} template void view(const std::vector >& vv){cerr << endl;int cnt = 0;for(const auto& v : vv){cerr << cnt << "th : "; view(v); cnt++;} cerr << endl;} ll power(ll a, ll p){ll ret = 1; while(p){if(p & 1){ret = ret * a;} a = a * a; p >>= 1;} return ret;} ll modpow(ll a, ll p, ll mod){ll ret = 1; while(p){if(p & 1){ret = ret * a % mod;} a = a * a % mod; p >>= 1;} return ret;} ll modinv(ll a, ll m) {ll b = m, u = 1, v = 0; while (b) {ll t = a / b ;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;} templatebool chmax(T &a, const K b) { if (abool chmin(T &a, const K b) { if (b> n >> mod; Comb_init(); V> dp(n + 1, V(n)); auto add = [&](ll &a, ll b)->void{ a += b; if(a >= mod) a -= mod; }; dp[0][0] = 1; for(int v = 0; v < n; v++) for(int e = 0; e <= max(0, v - 1); e++){ for(int nv = 1; nv + v <= n; nv++){ int ne = nv - 1; ll choose = comb(n - v - 1, nv - 1); if(nv >= 2) add(dp[v + nv][e + ne], (dp[v][e] * choose) % mod * modpow(nv, nv - 2, mod) % mod); else add(dp[v + nv][e + ne], dp[v][e]); } } rep(i,n){ cout << dp[n][i] << '\n'; } }