#include #include using namespace std; int a[3009]; long long cb[3009][3009], ans[3009], md = 998244353; int main() { ios::sync_with_stdio(false); cin.tie(0); int n, l; cin >> n >> l; cb[0][0] = 1; for (int i = 1; i <= n; i++) { cin >> a[i]; cb[i][0] = 1; for (int j = 1; j <= n; j++) cb[i][j] = (cb[i - 1][j - 1] + cb[i - 1][j]) % md; } for (int i = 1; i <= n; i++) { for (int pi = 0; pi < 2; pi++) { int c = n - 1, lc = 0, rc = 0, h = a[i]; if (pi) h = l - a[i]; bool f = true; for (int j = 1; j <= n; j++) { if (i == j) continue; bool lf = (a[j] <= h), rf = ((l - a[j]) <= h); if (j > i) { if (a[j] == h) lf = false; if (l - a[j] == h) rf = false; } if (!lf && !rf) { f = false; break; } else if (!lf || !rf) { c--; if (!lf) rc++; else lc++; } } if (!f) continue; for (int j = 0; j <= c; j++) ans[lc + j + 1] = (ans[lc + j + 1] + cb[c][j]) % md; } } for (int i = 1; i <= n; i++) cout << ans[i] << '\n'; return 0; }