/*{{{*/ #include #ifdef LOCAL int c_ = 0; #define cout (c_?cerr:cout) #define debug(...) \ {if(!c_++)cerr<<"\033[96;1m"; \ __VA_ARGS__; \ if(!--c_)cerr<<"\033[0m";} #else #define debug(...) {} #endif #define assrt(...) debug(\ if (not (__VA_ARGS__)) \ exit((cerr << __LINE__ << ": " << #__VA_ARGS__ << '\n', 0));\ ) #define st first #define nd second #define all(...) (__VA_ARGS__).begin(), (__VA_ARGS__).end() using namespace std; using ll = long long; using ld = long double; template < typename t > using V = vector< t >; template < typename t, size_t s > using A = array< t, s >; void print() {cout << '\n';} template< typename t, typename... v > void print(const t& a, const v&... b) {cout << a << (sizeof...(b)?" ":""); print(b...);} template< typename t > void print_range(t a, const t& b) { while (a != b) cout << (*a++) << ' '; cout << '\n';} #define dump(...) debug(print(#__VA_ARGS__,'=',__VA_ARGS__)) #define dump_range(...) debug(cerr<<#__VA_ARGS__ << ": "; print_range(__VA_ARGS__)) /*}}}*/ constexpr int nax = 400, kax = 400, mod = 167772161; int n, k, tab[nax], ilo[nax + 1][kax + 1]; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin >> n >> k; for (int i = 0; i < n; ++i) { cin >> tab[i]; } ilo[0][0] = 1; for (int i = 0; i < n; ++i) { for (int j = n - 1; j >= 0; --j) { for (int l = 0; l + tab[i] <= k; ++l) { ilo[j + 1][l + tab[i]] += ilo[j][l]; if (ilo[j + 1][l + tab[i]] >= mod) { ilo[j + 1][l + tab[i]] -= mod; } } } } for (int j = 0; j <= n; ++j) { for (int l = 1; l <= k; ++l) { ilo[j][l] += ilo[j][l - 1]; if (ilo[j][l] >= mod) { ilo[j][l] -= mod; } } } for (int i = 0; i < n; ++i) { for (int j = 1; j < n; ++j) { int zn = +1; int su = 0; int tmpj = j; for (int ost = k; ost >= 0 and tmpj >= 0; ost -= tab[i]) { int tmp = ilo[tmpj][ost]; int tmp2 = (ost - tab[i] < 0? 0 : ilo[tmpj][ost - tab[i]]); int tmp3 = tmp - tmp2; if (tmp3 < 0) tmp3 += mod; su += zn * tmp3; if (su < 0) su += mod; if (su >= mod) su -= mod; //dump(i, j, tmpj, ost, tmp3, zn); zn = -zn; tmpj -= 1; } cout << su; if (j + 1 < n) { cout << ' '; } } cout << '\n'; } }