#include #include #include using namespace std; using namespace __gnu_pbds; #define ll long long #define lll __int128 #define ull unsigned long long #define fi first #define se second #define db double #define ld long double #define lld __float128 /// order_of_key, find_by_order template using custom_set = tree; template using ordered_set = tree, rb_tree_tag, tree_order_statistics_node_update>; template using ordered_multiset = tree, rb_tree_tag, tree_order_statistics_node_update>; template using ordered_map = tree, rb_tree_tag, tree_order_statistics_node_update>; mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count()); mt19937_64 rnd_64(chrono::steady_clock::now().time_since_epoch().count()); const ll MOD = 167772161; ll dp[405][405][405], ans[405][405], sum[405]; int main() { int n, k; cin >> n >> k; ll dat[n]; for(int i = 0; i < n; i++) cin >> dat[i]; dp[0][0][0] = 1; for(int i = 0; i < n; i++) { for(int sm = 0; sm <= k; sm++) { for(int cn = 0; cn <= i; cn++) { dp[i][sm][cn] %= MOD; dp[i+1][sm][cn] = (dp[i+1][sm][cn]+dp[i][sm][cn]) % MOD; if(sm+dat[i] <= k) { dp[i+1][sm+dat[i]][cn+1] = (dp[i+1][sm+dat[i]][cn+1] + dp[i][sm][cn])%MOD; } } } } for(int i = 0; i <= n; i++) { for(int sm = 0; sm <= k; sm++) { for(int cn = 0; cn <= i; cn++) { dp[i][sm][cn] %= MOD; } } } for(int c = 1; c <= k; c++) { for(int cnt = 1; cnt < n; cnt++) { ll vl = 1, cn = 0, kc = cnt, sm = k; while(sm >= 0 && kc >= 0) { ans[c][cnt] += vl*dp[n][sm][kc]; sm--; cn++; if(cn == c) { vl = -vl; cn = 0; kc--; } } ans[c][cnt] %= MOD; } } for(int i = 0; i < n; i++) { for(int j = 1; j < n; j++) { cout << ans[dat[i]][j] << ' '; } cout << '\n'; } } /// shche ne vmerla Ykraina