#include #include #include using namespace std; using ll = long long; using ull = unsigned long long; using ld = long double; using pii = pair; using pll = pair; using vi = vector; using vb = vector; using vc = vector; using vvc = vector; using vvi = vector; using vvb = vector; using vpii = vector; using vpll = vector; using vll = vector; using vull = vector; using vvll = vector; using namespace __gnu_pbds; template using ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; #define f first #define s second #define pb emplace_back #define rep(i, begin, end) for(auto i = (begin); i <= (end); ++i) #define repr(i, begin, end) for(auto i = (begin); i >= (end); --i) #define bend(X) X.begin(), X.end() #ifdef LOCAL #define deb(...) cout << #__VA_ARGS__ << " = " << __VA_ARGS__ << endl #define say(...) cout << __VA_ARGS__ << endl #else #define deb(x) #define say(x) #define endl '\n' #endif constexpr int INF = 1e9+1e7; constexpr ll INFl = INF; constexpr ll INFll = 1e18+1e16; void print() { cout << '\n'; } template void print(T x, Args... args) { cout << x << ' '; print(args...); } template ostream& operator<<(ostream& os, pair x) { os << x.f << ' ' << x.s; return os; } template istream& operator>>(istream& is, pair& x) { is >> x.f >> x.s; return is; } template ostream& operator<<(basic_ostream& os, T x) { for(auto i : x) os << i << ' '; return os; } template istream& operator>>(istream& is, vector& x) { for(T& i : x) is >> i; return is; } template pair operator+(const pair& A, const pair& B) { return {A.f+B.f, A.s+B.s}; } template pair operator-(const pair& A, const pair& B) { return {A.f-B.f, A.s-B.s}; } template pair& operator+=(pair& A, const pair& B) { A.f += B.f; A.s += B.s; return A; } template pair& operator-=(pair& A, const pair& B) { A.f -= B.f; A.s -= B.s; return A; } template pair operator-(const pair& A) { return {-A.f, -A.s}; } template bool maxe(T1& A, const T2& B) { if(B>A) { A=B; return 1; } return 0; } template bool mine(T1& A, const T2& B) { if(B Nic operator<<(Nic, T) { return nic; } Nic operator<<(ostream&, Nic) { return nic; } template T fastpow(const T& x, const unsigned long long& p) { if (p == 1) return x; return (p&1) ? fastpow(x*x, p/2)*x : fastpow(x*x, p/2); } template class nu { private: ll v; // constructor called when you know v will be in [0,mod), so no modulo is performed nu(ll val, void* _) : v{val} {}; public: nu(ll val = 0) : v{val} { if (v >= mod || v <= -mod) v %= mod; if (v < 0) v += mod; }; operator ll() { return v; } nu operator+(const nu& o) const { return nu{v+o.v >= mod ? v+o.v-mod : v+o.v, nullptr}; } nu operator-(const nu& o) const { return nu{v-o.v < 0 ? v-o.v+mod : v-o.v, nullptr}; } nu operator*(const nu& o) const { return nu{(v*o.v)%mod, nullptr}; } nu operator+=(const nu& o) { v += o.v; if (v >= mod) v -= mod; return *this; } nu operator-=(const nu& o) { v -= o.v; if (v < 0) v += mod; return *this; } nu operator*=(const nu& o) { v *= o.v; if (v >= mod) v %= mod; return *this; } // assumes mod is prime nu inv() const { return fastpow(*this, mod-2); } nu operator/(const nu& o) const { return (*this) * o.inv(); } nu operator/=(const nu& o) { v = ((*this)/o).v; return *this; } static vector> all_inverses(size_t n) { vector> inv(n+1); inv[1] = 1; for (int i = 2; i <= n; i++) inv[i] = nu(mod - (mod/i) * inv[mod%i] % mod, nullptr); return inv; } static vector> all_inverses() { return all_inverses(mod-1); } }; using num=nu<167772161>; ////////////////////////////////////////////////// constexpr int maxN = 401; constexpr int maxK = 401; int n, k; vi T; num DP[maxN][maxK], DP1[maxN][maxK], DP2[maxN][maxK]; auto solve() { cin >> n >> k; T.resize(n+1); rep (i, 1, n) cin >> T[i]; DP[0][0] = num{1}; rep (i, 1, n) { int x = T[i]; repr (j, n, 1) rep (w, x, k) DP[j][w] += DP[j-1][w-x]; } rep (z, 1, n) { int x = T[z]; rep (j, 0, n) rep (w, 0, k) DP1[j][w] = DP2[j][w] = num{0}; DP1[0][0] = num{1}; rep (j, 1, n) rep (w, 0, k) { DP2[j][w] = w >= x ? DP1[j-1][w-x] : num{0}; DP1[j][w] = DP[j][w] - DP2[j][w]; } rep (j, 1, n-1) { num res{0}; rep (w, k-x+1, k) res += DP1[j][w]; cout << ll(res) << " \n"[j==n-1]; } } return nic; } int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int noOfTests = 1; //cin >> noOfTests; while(noOfTests --> 0) cout << solve() << '\n'; return 0; }