#include #include #include using namespace std; #define FOR(i, begin, end) for(int i=(begin),i##_end_=(end);i istream &operator>>(istream &is, vector &vec) { for (auto &v : vec) is >> v; return is; } template struct ModInt { #if __cplusplus >= 201402L #define MDCONST constexpr #else #define MDCONST #endif int val; MDCONST ModInt() : val(0) {} MDCONST ModInt &_setval(int v) { return val = (v >= md ? v - md : v), *this; } MDCONST ModInt(int v) { _setval(v); } MDCONST explicit operator bool() const { return val != 0; } MDCONST ModInt operator+(const ModInt &x) const { return ModInt()._setval(val + x.val); } MDCONST ModInt operator-(const ModInt &x) const { return ModInt()._setval(val - x.val + md); } MDCONST ModInt operator-() const { return ModInt()._setval(md - val); } MDCONST ModInt &operator+=(const ModInt &x) { return *this = *this + x; } MDCONST ModInt &operator-=(const ModInt &x) { return *this = *this - x; } MDCONST friend std::ostream &operator<<(std::ostream &os, const ModInt &x) { return os << x.val; } }; using mint = ModInt<998244353>; int main() { cin.tie(nullptr), ios::sync_with_stdio(false); int N, L; cin >> N >> L; vector A(N); for (auto &x : A) cin >> x; vector> w2i(N); REP(i, N) { if (i and A[i - 1] >= L - A[i]) break; int r = lower_bound(A.begin() + i + 1, A.end(), L - A[i]) - A.begin(); w2i[N - 1 - (r - i - 1)].push_back(i + (r - i - 1)); } REP(i, N) { if (i + 1 < N and L - A[i + 1] > A[i]) continue; int l = lower_bound(A.begin(), A.begin() + i, L - A[i]) - A.begin() - 1; w2i[N - 1 - (i - l - 1)].push_back(l + 1 + (i - l - 1)); } vector ret(N); for (auto is : w2i) { REP(i, ret.size() - 1) ret[i] += ret[i + 1]; for (auto i : is) ret[i] += 1; } for (auto x : ret) cout << x << '\n'; }