// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::pair;using std::set;using std::string;using std::vector;
using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;
#define ff first
#define ss second
#define pb emplace_back
template<typename T>void _dbg(const char*_s,T _h){cerr<<_s<<" = "<<_h<<"\n";}
template<typename T,typename...Ts>void _dbg(const char*_s,T _h,Ts..._t){int _b=0;while(((_b+=*_s=='(')-=*_s==')')!=0||*_s!=',')cerr<<*_s++;cerr<<" = "<<_h<<",";_dbg(_s+1,_t...);}
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#endif
}}init;
const int MAXLOG = 5;
const int MAXN = 1 << MAXLOG;
const int BLEN = 4;
const int BASE = 1e4;

struct cpx {
    double x, y;
    cpx() { }
    cpx(double angle) : x(cos(angle)), y(sin(angle)) { }
    cpx(double _x_, double _y_) : x(_x_), y(_y_) { }
    cpx operator * (double k)     const { return cpx(x * k, y * k); }
    cpx operator + (const cpx &a) const { return cpx(x + a.x, y + a.y); }
    cpx operator - (const cpx &a) const { return cpx(x - a.x, y - a.y); }
    cpx operator * (const cpx &a) const { return cpx(x * a.x - y * a.y, x * a.y + y * a.x); }
    cpx conj() { return cpx(x, -y); }
};
ll r[MAXN];
cpx fft_from[MAXN], fft_to[MAXN], root[MAXN];
int rev[MAXN];
ll fft_res[MAXN];
struct fft_init{
    fft_init() {
        for (int i = 0; i < MAXN; ++i)
            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (MAXLOG - 1));
        for (int k = 1; k < MAXN; k *= 2) {
            cpx tmp(3.1415926535897932384626433 / k);
            root[k] = {1, 0};
            for (int i = 1; i < k; i++)
                root[k + i] = (i & 1) ? root[(k + i) >> 1] * tmp : root[(k + i) >> 1];
        }
    }
} fft_init;

void fft(const cpx *a, cpx *res) {
    for (int i = 0; i < MAXN; ++i)
        res[rev[i]] = a[i];
    for (int k = 1; k < MAXN; k *= 2)
        for (int i = 0; i < MAXN; i += 2 * k)
            for (int j = 0; j < k; ++j) {
                cpx tmp = root[k + j] * res[i + j + k];
                res[i + j + k] = res[i + j] - tmp;
                res[i + j] = res[i + j] + tmp;
            }
}

ll ans[MAXN];
int32_t main() {

    int n, x;
    cin >> n >> x;
    int s = 0, c = 1;
    for (int i = 1; i <= n; ++i) {
        int y;
        cin >> y;
        if (y < x) {
            r[s++] = c;
            c = 1;
        } else {
            c++;
        }
    }

    r[s++] = c;

    for (int i = 0; i < s; ++i)
        ans[0] += (r[i] * (r[i] - 1)) / 2;
    cout << ans[0] << ' ';

    for (int i = 0; i < s; ++i) {
        fft_from[i].x = r[i];
        fft_from[i].y = r[s - i - 1];
        // dbg(fft_from[i].x, fft_from[i].y);
    }

    fft(fft_from, fft_to);
    for (int i = 0; i <= MAXN / 2; ++i) {
        int j = i ? MAXN - i : 0;
        cpx z0 = fft_to[i], z1 = fft_to[j];
        fft_to[i] = cpx(z0.x + z1.x, z0.y - z1.y) * cpx(z0.y + z1.y, z1.x - z0.x) * 0.25;
        fft_to[j] = fft_to[i].conj();
    }
    fft(fft_to, fft_from);
    for (int i = 0; i < MAXN; ++i)  {
        // dbg(fft_from[i].x);
        fft_from[i].x /= MAXN;
    }
    std::reverse(fft_from + 1, fft_from + MAXN);

    for (int i = 0; i + 1 < s; ++i) {
        // dbg(i, fft_from[i + s].x);
        cout << ((ll)(fft_from[i + s].x + 0.5)) << ' ';
    }

    for (int i = s + 1; i <= n + 1; ++i)
        cout << "0 ";
    cout << '\n';

    return 0;
}


// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::pair;using std::set;using std::string;using std::vector;
using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;
#define ff first
#define ss second
#define pb emplace_back
template<typename T>void _dbg(const char*_s,T _h){cerr<<_s<<" = "<<_h<<"\n";}
template<typename T,typename...Ts>void _dbg(const char*_s,T _h,Ts..._t){int _b=0;while(((_b+=*_s=='(')-=*_s==')')!=0||*_s!=',')cerr<<*_s++;cerr<<" = "<<_h<<",";_dbg(_s+1,_t...);}
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#endif
}}init;
const int MAXLOG = 19;
const int MAXN = 1 << MAXLOG;
const int BLEN = 4;
const int BASE = 1e4;

struct cpx {
    double x, y;
    cpx() { }
    cpx(double angle) : x(cos(angle)), y(sin(angle)) { }
    cpx(double _x_, double _y_) : x(_x_), y(_y_) { }
    cpx operator * (double k)     const { return cpx(x * k, y * k); }
    cpx operator + (const cpx &a) const { return cpx(x + a.x, y + a.y); }
    cpx operator - (const cpx &a) const { return cpx(x - a.x, y - a.y); }
    cpx operator * (const cpx &a) const { return cpx(x * a.x - y * a.y, x * a.y + y * a.x); }
    cpx conj() { return cpx(x, -y); }
};
ll r[MAXN];
cpx fft_from[MAXN], fft_to[MAXN], root[MAXN];
int rev[MAXN];
ll fft_res[MAXN];
struct fft_init{
    fft_init() {
        for (int i = 0; i < MAXN; ++i)
            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (MAXLOG - 1));
        for (int k = 1; k < MAXN; k *= 2) {
            cpx tmp(3.1415926535897932384626433 / k);
            root[k] = {1, 0};
            for (int i = 1; i < k; i++)
                root[k + i] = (i & 1) ? root[(k + i) >> 1] * tmp : root[(k + i) >> 1];
        }
    }
} fft_init;

void fft(const cpx *a, cpx *res) {
    for (int i = 0; i < MAXN; ++i)
        res[rev[i]] = a[i];
    for (int k = 1; k < MAXN; k *= 2)
        for (int i = 0; i < MAXN; i += 2 * k)
            for (int j = 0; j < k; ++j) {
                cpx tmp = root[k + j] * res[i + j + k];
                res[i + j + k] = res[i + j] - tmp;
                res[i + j] = res[i + j] + tmp;
            }
}

ll ans[MAXN];
int32_t main() {

    int n, x;
    cin >> n >> x;
    int s = 0, c = 1;
    for (int i = 1; i <= n; ++i) {
        int y;
        cin >> y;
        if (y < x) {
            r[s++] = c;
            c = 1;
        } else {
            c++;
        }
    }

    r[s++] = c;

    for (int i = 0; i < s; ++i)
        ans[0] += (r[i] * (r[i] - 1)) / 2;
    cout << ans[0] << ' ';

    for (int i = 0; i < s; ++i) {
        fft_from[i].x = r[i];
        fft_from[i].y = r[s - i - 1];
        // dbg(fft_from[i].x, fft_from[i].y);
    }

    fft(fft_from, fft_to);
    for (int i = 0; i <= MAXN / 2; ++i) {
        int j = i ? MAXN - i : 0;
        cpx z0 = fft_to[i], z1 = fft_to[j];
        fft_to[i] = cpx(z0.x + z1.x, z0.y - z1.y) * cpx(z0.y + z1.y, z1.x - z0.x) * 0.25;
        fft_to[j] = fft_to[i].conj();
    }
    fft(fft_to, fft_from);
    for (int i = 0; i < MAXN; ++i)  {
        // dbg(fft_from[i].x);
        fft_from[i].x /= MAXN;
    }
    std::reverse(fft_from + 1, fft_from + MAXN);

    for (int i = 0; i + 1 < s; ++i) {
        // dbg(i, fft_from[i + s].x);
        cout << ((ll)(fft_from[i + s].x + 0.5)) << ' ';
    }

    for (int i = s + 1; i <= n + 1; ++i)
        cout << "0 ";
    cout << '\n';

    return 0;
}


// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::pair;using std::set;using std::string;using std::vector;
using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;
#define ff first
#define ss second
#define pb emplace_back
template<typename T>void _dbg(const char*_s,T _h){cerr<<_s<<" = "<<_h<<"\n";}
template<typename T,typename...Ts>void _dbg(const char*_s,T _h,Ts..._t){int _b=0;while(((_b+=*_s=='(')-=*_s==')')!=0||*_s!=',')cerr<<*_s++;cerr<<" = "<<_h<<",";_dbg(_s+1,_t...);}
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#endif
}}init;

const int MAXN = 2e5 + 5;

int a[MAXN];
ll __attribute__((aligned(64))) r[MAXN];
int __attribute__((aligned(32))) rs[MAXN];

ll ans[MAXN];
int32_t main() {

    int n, x;
    cin >> n >> x;
    int s = 0;
    int c = 1;
    std::multiset<int, std::greater<int>> ss;
    for (int i = 1; i <= n; ++i) {
        cin >> a[i];
        if (a[i] < x) {
            a[i] = 1;
            rs[s] = c;
            r[s++] = c;
            ss.insert(c);
            c = 1;
        } else {
            a[i] = 0;
            c++;
        }
    }

    rs[s] = c;
    r[s++] = c;
    ss.insert(c);

    bool usesmall = 0;
    if (ss.size() >= 2) {
        ll m1 = *ss.begin();
        ss.erase(ss.begin());
        ll m2 = *ss.begin();
        if (m1 * m2 < 2147483648LL)
            usesmall = 1;
    }

    // ll sum = 0;
    // for (int i = s - 1; i >= 0; --i)  {
    //     stolb[i] = sum * r[i];
    //     sum += r[i];
    // }

    for (int i = 0; i < s; ++i)
        ans[0] += (r[i] * (r[i] - 1)) / 2;
    cout << ans[0] << ' ';

    if (usesmall) {
        for (int d = 1; d <= s - 1; ++d) {
            for (int i = 0; i + d < s; ++i)
                ans[d] += rs[i] * rs[i + d];
            cout << ans[d] << ' ';
        }
    }
     else {
    for (int d = 1; d <= s - 1; ++d) {
        for (int i = 0; i + d < s; ++i)
            ans[d] += r[i] * r[i + d];
        cout << ans[d] << ' ';
    }
}
    for (int i = s + 1; i <= n + 1; ++i)
        cout << "0 ";
    cout << '\n';

    return 0;
}


// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //
// 🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤🖤 //

#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")
#include <bits/stdc++.h>
using std::cerr;using std::cin;using std::cout;using std::abs;using std::min;using std::max;using std::swap;using std::map;using std::pair;using std::set;using std::string;using std::vector;
using ll=long long;using uint=unsigned int;using pii=pair<int,int>;using pll=pair<ll,ll>;using ull = unsigned long long;using ld=long double;
#define ff first
#define ss second
#define pb emplace_back
template<typename T>void _dbg(const char*_s,T _h){cerr<<_s<<" = "<<_h<<"\n";}
template<typename T,typename...Ts>void _dbg(const char*_s,T _h,Ts..._t){int _b=0;while(((_b+=*_s=='(')-=*_s==')')!=0||*_s!=',')cerr<<*_s++;cerr<<" = "<<_h<<",";_dbg(_s+1,_t...);}
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif
struct init{init(){cin.tie(0);std::iostream::sync_with_stdio(0);cout<<std::fixed<<std::setprecision(10);cerr<<std::fixed<<std::setprecision(5);}~init(){
#ifdef LOCAL
cerr<<"Time elapsed: "<<(double)clock()/CLOCKS_PER_SEC<<"s.\n";
#endif
}}init;
const int MAXLOG = 5;
const int MAXN = 1 << MAXLOG;
const int BLEN = 4;
const int BASE = 1e4;

struct cpx {
    double x, y;
    cpx() { }
    cpx(double angle) : x(cos(angle)), y(sin(angle)) { }
    cpx(double _x_, double _y_) : x(_x_), y(_y_) { }
    cpx operator * (double k)     const { return cpx(x * k, y * k); }
    cpx operator + (const cpx &a) const { return cpx(x + a.x, y + a.y); }
    cpx operator - (const cpx &a) const { return cpx(x - a.x, y - a.y); }
    cpx operator * (const cpx &a) const { return cpx(x * a.x - y * a.y, x * a.y + y * a.x); }
    cpx conj() { return cpx(x, -y); }
};
ll r[MAXN];
cpx fft_from[MAXN], fft_to[MAXN], root[MAXN];
int rev[MAXN];
ll fft_res[MAXN];
struct fft_init{
    fft_init() {
        for (int i = 0; i < MAXN; ++i)
            rev[i] = (rev[i >> 1] >> 1) + ((i & 1) << (MAXLOG - 1));
        for (int k = 1; k < MAXN; k *= 2) {
            cpx tmp(M_PI / k);
            root[k] = {1, 0};
            for (int i = 1; i < k; i++)
                root[k + i] = (i & 1) ? root[(k + i) >> 1] * tmp : root[(k + i) >> 1];
        }
    }
} fft_init;

void fft(const cpx *a, cpx *res) {
    for (int i = 0; i < MAXN; ++i)
        res[rev[i]] = a[i];
    for (int k = 1; k < MAXN; k *= 2)
        for (int i = 0; i < MAXN; i += 2 * k)
            for (int j = 0; j < k; ++j) {
                cpx tmp = root[k + j] * res[i + j + k];
                res[i + j + k] = res[i + j] - tmp;
                res[i + j] = res[i + j] + tmp;
            }
}

ll ans[MAXN];
int32_t main() {

    int n, x;
    cin >> n >> x;
    int s = 0, c = 1;
    for (int i = 1; i <= n; ++i) {
        int y;
        cin >> y;
        if (y < x) {
            r[s++] = c;
            c = 1;
        } else {
            c++;
        }
    }

    r[s++] = c;

    for (int i = 0; i < s; ++i)
        ans[0] += (r[i] * (r[i] - 1)) / 2;
    cout << ans[0] << ' ';

    for (int i = 0; i < s; ++i) {
        fft_from[i].x = r[i];
        fft_from[i].y = r[s - i - 1];
        // dbg(fft_from[i].x, fft_from[i].y);
    }

    fft(fft_from, fft_to);
    for (int i = 0; i <= MAXN / 2; ++i) {
        int j = i ? MAXN - i : 0;
        cpx z0 = fft_to[i], z1 = fft_to[j];
        fft_to[i] = cpx(z0.x + z1.x, z0.y - z1.y) * cpx(z0.y + z1.y, z1.x - z0.x) * 0.25;
        fft_to[j] = fft_to[i].conj();
    }
    fft(fft_to, fft_from);
    for (int i = 0; i < MAXN; ++i)  {
        // dbg(fft_from[i].x);
        fft_from[i].x /= MAXN;
    }
    std::reverse(fft_from + 1, fft_from + MAXN);

    for (int i = 0; i + 1 < s; ++i) {
        // dbg(i, fft_from[i + s].x);
        cout << ((ll)(fft_from[i + s].x + 0.5)) << ' ';
    }

    for (int i = s + 1; i <= n + 1; ++i)
        cout << "0 ";
    cout << '\n';

    return 0;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <complex>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pi acos(-1)

using namespace std;

const int N = 10000010;
typedef long long LL;
typedef complex<double> E;
E b0[N], b1[N];

void fft(E *a, int len, int f)
{
	for (int i = 0, j = 0; i < len; i ++) {
		if (i < j) swap(a[i], a[j]);
		for (int t = len >> 1; (j ^= t) < t; t >>= 1);
	}
	for (int i = 1; i < len; i <<= 1) {
        E wn(cos(pi / i), sin(pi / i) * f);
        for (int j = 0; j < len; j += (i << 1)){
            E w(1, 0);
            for (int k = 0; k < i; k ++, w = w * wn)
            {
                E x = a[j + k], y = w * a[j + k + i];
                a[j + k] = x + y; a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) Rep0(i, len) a[i] /= len;
}

int a[N];
LL ans[N];

int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	Rep(i, n){
		scanf("%d", &a[i]);
		if (a[i] < x) a[i] = 1;
		else a[i] = 0;
	}

	int la = 0, cnt = -1;
	Rep(i, n) if (a[i] == 1) b0[++ cnt] = i - la, la = i, ans[0] += 1ll * (i - la - 1) * (i - la - 2) / 2 + i - la - 1;
	b0[++ cnt] = n + 1 - la, ans[0] += 1ll * (n - la) * (n - la - 1) / 2 + n - la;
	//printf("%lld\n", ans[0]);
	Rep0(i, cnt) b1[i] = b0[cnt - i];

	int len = 1;
	while (len <= (cnt << 1)) len <<= 1;

	fft(b0, len, 1); fft(b1, len, 1);
	Rep0(i, len - 1) b0[i] = b0[i] * b1[i];
	fft(b0, len, -1);
	Rep(i, cnt) ans[i] = (LL)(b0[cnt - i].real() + 0.5);

	Rep0(i, n) printf("%lld ", ans[i]);
	printf("\n");

	return 0;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <complex>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pi acos(-1)

using namespace std;

const int N = 2000010;
typedef long long LL;
typedef complex<double> E;
E b0[N], b1[N];

void fft(E *a, int len, int f)
{
	for (int i = 0, j = 0; i < len; i ++) {
		if (i < j) swap(a[i], a[j]);
		for (int t = len >> 1; (j ^= t) < t; t >>= 1);
	}
	for (int i = 1; i < len; i <<= 1) {
        E wn(cos(pi / i), sin(pi / i) * f);
        for (int j = 0; j < len; j += (i << 1)){
            E w(1, 0);
            for (int k = 0; k < i; k ++, w = w * wn)
            {
                E x = a[j + k], y = w * a[j + k + i];
                a[j + k] = x + y; a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) Rep0(i, len) a[i] /= len;
}

int a[N];
LL ans[N];

int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	Rep(i, n){
		scanf("%d", &a[i]);
		if (a[i] < x) a[i] = 1;
		else a[i] = 0;
	}

	int la = 0, cnt = -1;
	Rep(i, n) if (a[i] == 1){
		b0[++ cnt] = i - la, ans[0] += 1ll * (i - la - 1) * (i - la - 2) / 2 + i - la - 1, la = i;
		//printf("%d\n", i - la - 1);
	}
	//printf("%lld\n", ans[0]);
	b0[++ cnt] = n + 1 - la, ans[0] += 1ll * (n - la) * (n - la - 1) / 2 + n - la;
	Rep0(i, cnt) b1[i] = b0[cnt - i];

	int len = 1;
	while (len <= (cnt << 1)) len <<= 1;

	fft(b0, len, 1); fft(b1, len, 1);
	Rep0(i, len - 1) b0[i] = b0[i] * b1[i];
	fft(b0, len, -1);
	Rep(i, cnt) ans[i] = (LL)(b0[cnt - i].real() + 0.5);

	Rep0(i, n) printf("%lld ", ans[i]);
	printf("\n");

	return 0;
}
/*
3 1
1 0 1
*/


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <complex>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pi acos(-1)

using namespace std;

const int N = 2000010;
typedef long long LL;
typedef complex<double> E;
E b0[N], b1[N];

void fft(E *a, int len, int f)
{
	for (int i = 0, j = 0; i < len; i ++) {
		if (i < j) swap(a[i], a[j]);
		for (int t = len >> 1; (j ^= t) < t; t >>= 1);
	}
	for (int i = 1; i < len; i <<= 1) {
        E wn(cos(pi / i), sin(pi / i) * f);
        for (int j = 0; j < len; j += (i << 1)){
            E w(1, 0);
            for (int k = 0; k < i; k ++, w = w * wn)
            {
                E x = a[j + k], y = w * a[j + k + i];
                a[j + k] = x + y; a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) Rep0(i, len) a[i] /= len;
}

int a[N];
LL ans[N];

int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	Rep(i, n){
		scanf("%d", &a[i]);
		if (a[i] < x) a[i] = 1;
		else a[i] = 0;
	}

	int la = 0, cnt = -1;
	Rep(i, n) if (a[i] == 1) b0[++ cnt] = i - la, la = i, ans[0] += 1ll * (i - la - 1) * (i - la - 2) / 2 + i - la - 1;
	b0[++ cnt] = n + 1 - la, ans[0] += 1ll * (n - la) * (n - la - 1) / 2 + n - la;
	//printf("%lld\n", ans[0]);
	Rep0(i, cnt) b1[i] = b0[cnt - i];

	int len = 1;
	while (len <= (cnt << 1)) len <<= 1;

	fft(b0, len, 1); fft(b1, len, 1);
	Rep0(i, len - 1) b0[i] = b0[i] * b1[i];
	fft(b0, len, -1);
	Rep(i, cnt) ans[i] = (LL)(b0[cnt - i].real() + 0.5);

	Rep0(i, n) printf("%lld ", ans[i]);
	printf("\n");

	return 0;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <complex>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pi acos(-1)

using namespace std;

const int N = 1000010;
typedef long long LL;
typedef complex<double> E;
E b0[N], b1[N];

void fft(E *a, int len, int f)
{
	for (int i = 0, j = 0; i < len; i ++) {
		if (i < j) swap(a[i], a[j]);
		for (int t = len >> 1; (j ^= t) < t; t >>= 1);
	}
	for (int i = 1; i < len; i <<= 1) {
        E wn(cos(pi / i), sin(pi / i) * f);
        for (int j = 0; j < len; j += (i << 1)){
            E w(1, 0);
            for (int k = 0; k < i; k ++, w = w * wn)
            {
                E x = a[j + k], y = w * a[j + k + i];
                a[j + k] = x + y; a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) Rep0(i, len) a[i] /= len;
}

int a[N];
LL ans[N];

int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	Rep(i, n){
		scanf("%d", &a[i]);
		if (a[i] < x) a[i] = 1;
		else a[i] = 0;
	}

	int la = 0, cnt = -1;
	Rep(i, n) if (a[i] == 1) b0[++ cnt] = i - la, la = i, ans[0] += 1ll * (i - la - 1) * (i - la - 2) / 2 + i - la - 1;
	b0[++ cnt] = n + 1 - la, ans[0] += 1ll * (n - la) * (n - la - 1) / 2 + n - la;
	//printf("%lld\n", ans[0]);
	Rep0(i, cnt) b1[i] = b0[cnt - i];

	int len = 1;
	while (len <= (cnt << 1)) len <<= 1;

	fft(b0, len, 1); fft(b1, len, 1);
	Rep0(i, len - 1) b0[i] = b0[i] * b1[i];
	fft(b0, len, -1);
	Rep(i, cnt) ans[i] = (LL)(b0[cnt - i].real() + 0.5);

	Rep0(i, n) printf("%lld ", ans[i]);
	printf("\n");

	return 0;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <complex>

#define Rep(i, n) for (int i = 1; i <= n; i ++)
#define Rep0(i, n) for (int i = 0; i <= n; i ++)
#define RepG(i, x) for (int i = head[x]; i; i = edge[i].next)
#define v edge[i].to
#define mp(a, b) make_pair(a, b)
#define fi first
#define se second
#define pi acos(-1)

using namespace std;

const int N = 1000010;
typedef long long LL;
typedef complex<double> E;
E b0[N], b1[N];

void fft(E *a, int len, int f)
{
	for (int i = 0, j = 0; i < len; i ++) {
		if (i < j) swap(a[i], a[j]);
		for (int t = len >> 1; (j ^= t) < t; t >>= 1);
	}
	for (int i = 1; i < len; i <<= 1) {
        E wn(cos(pi / i), sin(pi / i) * f);
        for (int j = 0; j < len; j += (i << 1)){
            E w(1, 0);
            for (int k = 0; k < i; k ++, w = w * wn)
            {
                E x = a[j + k], y = w * a[j + k + i];
                a[j + k] = x + y; a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) Rep0(i, len) a[i] /= len;
}

int a[N], ans[N];

int main()
{
	int n, x;
	scanf("%d%d", &n, &x);
	Rep(i, n){
		scanf("%d", &a[i]);
		if (a[i] < x) a[i] = 1;
		else a[i] = 0;
	}

	int la = 0, cnt = -1;
	Rep(i, n) if (a[i] == 1) b0[++ cnt] = i - la, la = i, ans[0] += 1ll * (i - la - 1) * (i - la - 2) / 2 + i - la - 1;
	b0[++ cnt] = n + 1 - la, ans[0] += 1ll * (n - la) * (n - la - 1) / 2 + n - la;
	//printf("%lld\n", ans[0]);
	Rep0(i, cnt) b1[i] = b0[cnt - i];

	int len = 1;
	while (len <= (cnt << 1)) len <<= 1;

	fft(b0, len, 1); fft(b1, len, 1);
	Rep0(i, len - 1) b0[i] = b0[i] * b1[i];
	fft(b0, len, -1);
	Rep(i, cnt) ans[i] = (LL)(b0[cnt - i].real() + 0.5);

	Rep0(i, n) printf("%lld ", ans[i]);
	printf("\n");

	return 0;
}


// e-nikita-and-order-statistics.yml
#include "bits/stdc++.h"
using namespace std;

// Defines
#define fs first
#define sn second
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define mtp make_tuple
#define all(x) (x).begin(), (x).end()
// Basic type definitions
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<long long, long long>;
// PBDS order statistic tree
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class comp = less<T>> using os_tree = tree<T, null_type, comp, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V, class comp = less<K>> using treemap = tree<K, V, comp, rb_tree_tag, tree_order_statistics_node_update>;
// HashSet
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { ll operator()(ll x) const { return x ^ RANDOM; } };
template <typename T, class Hash> using hashset = gp_hash_table<T, null_type, Hash>;
template <typename K, typename V, class Hash> using hashmap = gp_hash_table<K, V, Hash>;
// More utilities
int SZ(string &v) { return v.length(); }
template <typename C> int SZ(C &v) { return v.size(); }
template <typename T, typename U> void maxa(T &a, U b) { a = max(a, b); }
template <typename T, typename U> void mina(T &a, U b) { a = min(a, b); }
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;

using cd = complex<double>;
// using cd = complex<ld>;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = a.size();
    if (n == 1)
        return;

    vector<cd> a0(n / 2), a1(n / 2);
    for (int i = 0; 2 * i < n; i++) {
        a0[i] = a[2*i];
        a1[i] = a[2*i+1];
    }
    fft(a0, invert);
    fft(a1, invert);

    double ang = 2 * PI / n * (invert ? -1 : 1);
    cd w(1), wn(cos(ang), sin(ang));
    for (int i = 0; 2 * i < n; i++) {
        a[i] = a0[i] + w * a1[i];
        a[i + n/2] = a0[i] - w * a1[i];
        if (invert) {
            a[i] /= 2;
            a[i + n/2] /= 2;
        }
        w *= wn;
    }
}
vector<ll> multiply(vector<ll> const& a, vector<ll> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < SZ(a) + SZ(b))
        n <<= 1;
    fa.resize(n);
    fb.resize(n);

    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);

    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

const int MN = 2e5 + 1, B = 475;
int N, X,
    val[MN];
ll cnt[MN];

void solve(int l, int r) {
    if (l == r) return void(cnt[val[l]]++);
    int mid = (l + r) / 2;

    if (r - l + 1 > B) {
        vector<ll> cntl(mid - l + 2), cntr(r - mid + 1);
        int ccnt = 0;
        for (auto i = mid; i >= l; i--) {
            ccnt += val[i];
            cntl[ccnt]++;
        }
        ccnt = 0;
        for (auto i = mid+1; i <= r; i++) {
            ccnt += val[i];
            cntr[ccnt]++;
        }
        auto res = multiply(cntl, cntr);
        for (auto i = 0; i < SZ(res); i++)
            if (i <= N)
                cnt[i] += res[i];
        solve(l, mid); solve(mid + 1, r);
    }
    else {
        for (auto i = l; i <= r; i++) {
            int ccnt = 0;
            for (auto j = i; j <= r; j++) {
                ccnt += val[j];
                cnt[ccnt]++;
            }
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> (N) >> (X);
    for (auto i = 0; i < N; i++) {
        int x;
        cin >> x;
        val[i] = x < X;
    }

    solve(0, N - 1);

    for (auto i = 0; i <= N; i++)
        cout << cnt[i] << ' ';
    cout << '\n';

    return 0;
}


// e-nikita-and-order-statistics.yml
#include "bits/stdc++.h"
using namespace std;

// Defines
#define fs first
#define sn second
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define mtp make_tuple
#define all(x) (x).begin(), (x).end()
// Basic type definitions
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<long long, long long>;
// PBDS order statistic tree
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class comp = less<T>> using os_tree = tree<T, null_type, comp, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V, class comp = less<K>> using treemap = tree<K, V, comp, rb_tree_tag, tree_order_statistics_node_update>;
// HashSet
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { ll operator()(ll x) const { return x ^ RANDOM; } };
template <typename T, class Hash> using hashset = gp_hash_table<T, null_type, Hash>;
template <typename K, typename V, class Hash> using hashmap = gp_hash_table<K, V, Hash>;
// More utilities
int SZ(string &v) { return v.length(); }
template <typename C> int SZ(C &v) { return v.size(); }
template <typename T, typename U> void maxa(T &a, U b) { a = max(a, b); }
template <typename T, typename U> void mina(T &a, U b) { a = min(a, b); }
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;

using cd = complex<double>;
// using cd = complex<ld>;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = a.size();
    if (n == 1)
        return;

    vector<cd> a0(n / 2), a1(n / 2);
    for (int i = 0; 2 * i < n; i++) {
        a0[i] = a[2*i];
        a1[i] = a[2*i+1];
    }
    fft(a0, invert);
    fft(a1, invert);

    double ang = 2 * PI / n * (invert ? -1 : 1);
    cd w(1), wn(cos(ang), sin(ang));
    for (int i = 0; 2 * i < n; i++) {
        a[i] = a0[i] + w * a1[i];
        a[i + n/2] = a0[i] - w * a1[i];
        if (invert) {
            a[i] /= 2;
            a[i + n/2] /= 2;
        }
        w *= wn;
    }
}
vector<ll> multiply(vector<ll> const& a, vector<ll> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < SZ(a) + SZ(b))
        n <<= 1;
    fa.resize(n);
    fb.resize(n);

    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);

    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

const int MN = 2e5 + 1;
int N, X,
    val[MN];
vector<ll> icnt;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> (N) >> (X);
    for (auto i = 1; i <= N; i++) {
        int x;
        cin >> x;
        val[i] = (x < X) + val[i - 1];
    }
    icnt.resize(N + 1);
    for (auto i = 0; i <= N; i++)
        icnt[val[i]]++;

    vector<ll> revIcnt = icnt;
    reverse(all(revIcnt));

    vector<ll> res = multiply(icnt, revIcnt);

    res[N] = ll(N) * (N + 1) / 2;
    for (auto i = N+1; i <= 2*N; i++)
        res[N] -= res[i];
    for (auto i = N; i <= 2 * N; i++)
        cout << res[i] << ' ';
    cout << '\n';

    return 0;
}


// e-nikita-and-order-statistics.yml
#include "bits/stdc++.h"
using namespace std;

// Defines
#define fs first
#define sn second
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define mtp make_tuple
#define all(x) (x).begin(), (x).end()
// Basic type definitions
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<long long, long long>;
// PBDS order statistic tree
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class comp = less<T>> using os_tree = tree<T, null_type, comp, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V, class comp = less<K>> using treemap = tree<K, V, comp, rb_tree_tag, tree_order_statistics_node_update>;
// HashSet
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { ll operator()(ll x) const { return x ^ RANDOM; } };
template <typename T, class Hash> using hashset = gp_hash_table<T, null_type, Hash>;
template <typename K, typename V, class Hash> using hashmap = gp_hash_table<K, V, Hash>;
// More utilities
int SZ(string &v) { return v.length(); }
template <typename C> int SZ(C &v) { return v.size(); }
template <typename T, typename U> void maxa(T &a, U b) { a = max(a, b); }
template <typename T, typename U> void mina(T &a, U b) { a = min(a, b); }
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;

using cd = complex<double>;
// using cd = complex<ld>;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = a.size();
    if (n == 1)
        return;

    vector<cd> a0(n / 2), a1(n / 2);
    for (int i = 0; 2 * i < n; i++) {
        a0[i] = a[2*i];
        a1[i] = a[2*i+1];
    }
    fft(a0, invert);
    fft(a1, invert);

    double ang = 2 * PI / n * (invert ? -1 : 1);
    cd w(1), wn(cos(ang), sin(ang));
    for (int i = 0; 2 * i < n; i++) {
        a[i] = a0[i] + w * a1[i];
        a[i + n/2] = a0[i] - w * a1[i];
        if (invert) {
            a[i] /= 2;
            a[i + n/2] /= 2;
        }
        w *= wn;
    }
}
vector<ll> multiply(vector<ll> const& a, vector<ll> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < SZ(a) + SZ(b))
        n <<= 1;
    fa.resize(n);
    fb.resize(n);

    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);

    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

const int MN = 2e5 + 1, B = 700;
int N, X,
    val[MN];
ll cnt[MN];

void solve(int l, int r) {
    if (l == r) return void(cnt[val[l]]++);
    int mid = (l + r) / 2;

    if (r - l + 1 > B) {
        vector<ll> cntl(mid - l + 2), cntr(r - mid + 1);
        int ccnt = 0;
        for (auto i = mid; i >= l; i--) {
            ccnt += val[i];
            cntl[ccnt]++;
        }
        ccnt = 0;
        for (auto i = mid+1; i <= r; i++) {
            ccnt += val[i];
            cntr[ccnt]++;
        }
        auto res = multiply(cntl, cntr);
        for (auto i = 0; i < SZ(res); i++)
            if (i <= N)
                cnt[i] += res[i];
        solve(l, mid); solve(mid + 1, r);
    }
    else {
        for (auto i = l; i <= r; i++) {
            int ccnt = 0;
            for (auto j = i; j <= r; j++) {
                ccnt += val[j];
                cnt[ccnt]++;
            }
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> (N) >> (X);
    for (auto i = 0; i < N; i++) {
        int x;
        cin >> x;
        val[i] = x < X;
    }

    solve(0, N - 1);

    for (auto i = 0; i <= N; i++)
        cout << cnt[i] << ' ';
    cout << '\n';

    return 0;
}


// e-nikita-and-order-statistics.yml
#include "bits/stdc++.h"
using namespace std;

// Defines
#define fs first
#define sn second
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define mtp make_tuple
#define all(x) (x).begin(), (x).end()
// Basic type definitions
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<long long, long long>;
// PBDS order statistic tree
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class comp = less<T>> using os_tree = tree<T, null_type, comp, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V, class comp = less<K>> using treemap = tree<K, V, comp, rb_tree_tag, tree_order_statistics_node_update>;
// HashSet
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { ll operator()(ll x) const { return x ^ RANDOM; } };
template <typename T, class Hash> using hashset = gp_hash_table<T, null_type, Hash>;
template <typename K, typename V, class Hash> using hashmap = gp_hash_table<K, V, Hash>;
// More utilities
int SZ(string &v) { return v.length(); }
template <typename C> int SZ(C &v) { return v.size(); }
template <typename T, typename U> void maxa(T &a, U b) { a = max(a, b); }
template <typename T, typename U> void mina(T &a, U b) { a = min(a, b); }
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;

using cd = complex<double>;
// using cd = complex<ld>;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = a.size();
    if (n == 1)
        return;

    vector<cd> a0(n / 2), a1(n / 2);
    for (int i = 0; 2 * i < n; i++) {
        a0[i] = a[2*i];
        a1[i] = a[2*i+1];
    }
    fft(a0, invert);
    fft(a1, invert);

    double ang = 2 * PI / n * (invert ? -1 : 1);
    cd w(1), wn(cos(ang), sin(ang));
    for (int i = 0; 2 * i < n; i++) {
        a[i] = a0[i] + w * a1[i];
        a[i + n/2] = a0[i] - w * a1[i];
        if (invert) {
            a[i] /= 2;
            a[i + n/2] /= 2;
        }
        w *= wn;
    }
}
vector<ll> multiply(vector<ll> const& a, vector<ll> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < SZ(a) + SZ(b))
        n <<= 1;
    fa.resize(n);
    fb.resize(n);

    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);

    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

const int MN = 2e5 + 1;
int N, X,
    val[MN];
ll cnt[MN];

void solve(int l, int r) {
    if (l == r) return void(cnt[val[l]]++);
    int mid = (l + r) / 2;

    vector<ll> cntl(r - l + 2), cntr(r - l + 2);
    int ccnt = 0;
    for (auto i = mid; i >= l; i--) {
        ccnt += val[i];
        cntl[ccnt]++;
    }
    ccnt = 0;
    for (auto i = mid+1; i <= r; i++) {
        ccnt += val[i];
        cntr[ccnt]++;
    }

    auto res = multiply(cntl, cntr);
    for (auto i = 0; i < SZ(res); i++)
        cnt[i] += res[i];

    solve(l, mid); solve(mid + 1, r);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> (N) >> (X);
    for (auto i = 0; i < N; i++) {
        int x;
        cin >> x;
        val[i] = x < X;
    }

    solve(0, N - 1);

    for (auto i = 0; i <= N; i++)
        cout << cnt[i] << ' ';
    cout << '\n';

    return 0;
}


// e-nikita-and-order-statistics.yml
#include "bits/stdc++.h"
using namespace std;

// Defines
#define fs first
#define sn second
#define pb push_back
#define eb emplace_back
#define mpr make_pair
#define mtp make_tuple
#define all(x) (x).begin(), (x).end()
// Basic type definitions
using ll = long long; using ull = unsigned long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<long long, long long>;
// PBDS order statistic tree
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template <typename T, class comp = less<T>> using os_tree = tree<T, null_type, comp, rb_tree_tag, tree_order_statistics_node_update>;
template <typename K, typename V, class comp = less<K>> using treemap = tree<K, V, comp, rb_tree_tag, tree_order_statistics_node_update>;
// HashSet
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
const ll RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
struct chash { ll operator()(ll x) const { return x ^ RANDOM; } };
template <typename T, class Hash> using hashset = gp_hash_table<T, null_type, Hash>;
template <typename K, typename V, class Hash> using hashmap = gp_hash_table<K, V, Hash>;
// More utilities
int SZ(string &v) { return v.length(); }
template <typename C> int SZ(C &v) { return v.size(); }
template <typename T, typename U> void maxa(T &a, U b) { a = max(a, b); }
template <typename T, typename U> void mina(T &a, U b) { a = min(a, b); }
const ll INF = 0x3f3f3f3f, LLINF = 0x3f3f3f3f3f3f3f3f;

using cd = complex<double>;
// using cd = complex<ld>;
const double PI = acos(-1);

void fft(vector<cd> & a, bool invert) {
    int n = a.size();
    if (n == 1)
        return;

    vector<cd> a0(n / 2), a1(n / 2);
    for (int i = 0; 2 * i < n; i++) {
        a0[i] = a[2*i];
        a1[i] = a[2*i+1];
    }
    fft(a0, invert);
    fft(a1, invert);

    double ang = 2 * PI / n * (invert ? -1 : 1);
    cd w(1), wn(cos(ang), sin(ang));
    for (int i = 0; 2 * i < n; i++) {
        a[i] = a0[i] + w * a1[i];
        a[i + n/2] = a0[i] - w * a1[i];
        if (invert) {
            a[i] /= 2;
            a[i + n/2] /= 2;
        }
        w *= wn;
    }
}
vector<ll> multiply(vector<ll> const& a, vector<ll> const& b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    int n = 1;
    while (n < SZ(a) + SZ(b))
        n <<= 1;
    fa.resize(n);
    fb.resize(n);

    fft(fa, false);
    fft(fb, false);
    for (int i = 0; i < n; i++)
        fa[i] *= fb[i];
    fft(fa, true);

    vector<ll> result(n);
    for (int i = 0; i < n; i++)
        result[i] = round(fa[i].real());
    return result;
}

const int MN = 2e5 + 1;
int N, X,
    val[MN];
ll cnt[MN];

void solve(int l, int r) {
    if (l == r) return void(cnt[val[l]]++);
    int mid = (l + r) / 2;

    vector<ll> cntl(mid - l + 2), cntr(r - mid + 1);
    int ccnt = 0;
    for (auto i = mid; i >= l; i--) {
        ccnt += val[i];
        cntl[ccnt]++;
    }
    ccnt = 0;
    for (auto i = mid+1; i <= r; i++) {
        ccnt += val[i];
        cntr[ccnt]++;
    }

    auto res = multiply(cntl, cntr);
    for (auto i = 0; i < SZ(res); i++)
        if (i <= N)
            cnt[i] += res[i];

    solve(l, mid); solve(mid + 1, r);
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> (N) >> (X);
    for (auto i = 0; i < N; i++) {
        int x;
        cin >> x;
        val[i] = x < X;
    }

    solve(0, N - 1);

    for (auto i = 0; i <= N; i++)
        cout << cnt[i] << ' ';
    cout << '\n';

    return 0;
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int, int> ii;

const int N = 1 << 19;
const ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

vector<int> rev;
vector<base> w;

void prepare(int n) { // n is power of 2
	int sz = __builtin_ctz(n);
	if(rev.size() != n) {
		rev.assign(n, 0);
		for(int i = 0; i < n; ++i) {
			rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (sz - 1));
		}
	}

	if(w.size() >= n) return;
	if(w.empty()) w = {{0, 0}, {1, 0}};

	sz = __builtin_ctz(w.size());
	w.resize(n);

	// w[n + i] = w_{2n}^i, n power of 2, i < n
	while((1 << sz) < n) {
		double b = 2 * PI / (1 << (sz + 1)), ang = b;
		for(int i = 0; i < 1 << (sz - 1); ++i, ang += 2 * b) {
			int j = (1 << (sz - 1)) + i;
			w[2 * j] = w[j];
			w[2 * j + 1] = base(cos(ang), sin(ang));
		} ++sz;
	}
}

void fft(base *p, int n) {
	prepare(n);
	for(int i = 1; i < n - 1; ++i)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) {
		for(int s = 0; s < n; s += h << 1) {
			for(int i = 0; i < h; ++i) {
				base &u = p[s + i], &v = p[s + h + i],
					t = v * w[h + i];
				v = u - t; u = u + t;
			}
		}
	}
}

base f[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = n + m - 1;
	while(sz & (sz - 1)) sz = (sz | (sz - 1)) + 1;
	for(int i = 0; i < sz; ++i)
		f[i] = base(i < n ? a[i] : 0, i < m ? b[i] : 0);
	fft(f, sz);
	for(int i = 0; i <= (sz >> 1); ++i) {
		int j = (sz - i) & (sz - 1);
		base x = (f[i] * f[i] - (f[j] * f[j]).conj()) * base(0, -0.25);
		f[j] = x; f[i] = x.conj();
	}
	fft(f, sz);
	for(int i = 0; i < sz; ++i) c[i] = f[i].a / sz + 0.5;
}

int a[N], b[N], p, n, x;
ll c[N];

inline char read() {
	static const int IN_LEN = 1000000;
	static char buf[IN_LEN], *s, *t;
	return (s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin), (s == t ? -1 : *s++) : *s++);
}
template<class T>
inline void read(T &x) {
	static bool iosig;
	static char c;
	for (iosig = false, c = read(); !isdigit(c); c = read()) {
		if (c == '-') iosig = true;
		if (c == -1) return;
	}
	for (x = 0; isdigit(c); c = read()) x = ((x + (x << 2)) << 1) + (c ^ '0');
	if (iosig) x = -x;
}
const int OUT_LEN = 10000000;
char obuf[OUT_LEN], *ooh = obuf;
inline void print(char c) {
	if (ooh == obuf + OUT_LEN) fwrite(obuf, 1, OUT_LEN, stdout), ooh = obuf;
	*ooh++ = c;
}
template<class T>
inline void print(T x) {
	static int buf[30], cnt;
	if (x == 0) print('0');
	else {
		if (x < 0) print('-'), x = -x;
		for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 + 48;
		while (cnt) print((char)buf[cnt--]);
	}
}
inline void flush() { fwrite(obuf, 1, ooh - obuf, stdout); }

int main(int argc, char const *argv[]) {
	read(n); read(x);
	a[0] = 1;
	for(int i = 1, v; i <= n; ++i)
		read(v), ++a[p += (v < x)];
	for(int i = 0; i <= n; ++i)
		b[i] = a[n - i];

	mul(a, b, c, n + 1, n + 1);
	print(c[n] - n >> 1);
	for(int i = 1; i <= n; ++i)
		print(' '), print(c[n + i]);
	flush();
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long double ld;
ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

const int N = 1 << 19;
base w_pre[N|1], w[N|1]; int rev[N];

void calcw() {
	for(int i = 0; i <= N; ++i)
		w_pre[i] = base(cos(2*PI/N*i), sin(2*PI/N*i));
}
void calcrev(int n) {
	int sz = 31 - __builtin_clz(n); sz = abs(sz);
	for(int i = 1; i < n - 1; ++i)
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << sz - 1);
}
void fft(base *p, int n, int dir = 0) {
	for(int i = 1; i < n - 1; i++)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) { int l = h << 1;
		if(!dir) for(int j = 0; j < h; ++j) w[j] = w_pre[N/l*j];
		else for(int j = 0; j < h; ++j) w[j] = w_pre[N-N/l*j];
		for(int j = 0 ; j < n; j += l) {
			base t, *wn = w;
			base *u = p + j, *v = u + h, *e = v;
			while(u != e) {
				t = *v * *wn;
				*v = *u - t;
				*u = *u + t;
				++u, ++v, ++wn;
			}
		}
	} if(dir) for(int i = 0; i < n; ++i) p[i].a /= n, p[i].b /= n;
}

base f[N], g[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = 1;
	while(sz < n + m - 1) sz <<= 1;
	for(int i = 0; i < n; i++) f[i] = base(a[i], 0);
	for(int i = 0; i < m; i++) g[i] = base(b[i], 0);
	for(int i = n; i < sz; i++) f[i] = base(0, 0);
	for(int i = m; i < sz; i++) g[i] = base(0, 0);
	calcrev(sz);
	fft(f, sz);	fft(g, sz);
	for(int i = 0; i < sz; i++) f[i] = f[i] * g[i];
	fft(f, sz, 1);
	for(int i = 0; i < sz; i++) c[i] = f[i].a + 0.5;
}

int a[N], b[N], p[N], n, x;
ll c[N], zero;

int main(int argc, char const *argv[]) {
	calcw();
	scanf("%d %d", &n, &x);

	for(int i = 1, v; i <= n; ++i) {
		scanf("%d", &v);
		if(v < x) p[i] = 1;
	}

	a[0] = b[n] = 1;
	for(int i = 1, c = 0; i <= n; ++i) {
		p[i] += p[i - 1];
		++a[p[i]], ++b[n - p[i]];

		if(p[i] == p[i - 1]) ++c;
		else c = 0;
		zero += c;
	}

	mul(a, b, c, n + 1, n + 1);
	printf("%lld", zero);
	for(int i = 1; i <= n; ++i) {
		printf(" %lld", c[n + i]);
	}
	puts("");
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long double ld;
ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

const int N = 1 << 19;
base w_pre[N|1], w[N|1]; int rev[N];

void calcw() {
	for(int i = 0; i <= N; ++i)
		w_pre[i] = base(cos(2*PI/N*i), sin(2*PI/N*i));
}
void calcrev(int n) {
	int sz = 31 - __builtin_clz(n); sz = abs(sz);
	for(int i = 1; i < n - 1; ++i)
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << sz - 1);
}
void fft(base *p, int n, int dir = 0) {
	for(int i = 1; i < n - 1; i++)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) { int l = h << 1;
		if(!dir) for(int j = 0; j < h; ++j) w[j] = w_pre[N/l*j];
		else for(int j = 0; j < h; ++j) w[j] = w_pre[N-N/l*j];
		for(int j = 0 ; j < n; j += l) {
			base t, *wn = w;
			base *u = p + j, *v = u + h, *e = v;
			while(u != e) {
				t = *v * *wn;
				*v = *u - t;
				*u = *u + t;
				++u, ++v, ++wn;
			}
		}
	} if(dir) for(int i = 0; i < n; ++i) p[i].a /= n, p[i].b /= n;
}

base f[N], g[N], u[N], v[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = 1;
	while(sz < n + m - 1) sz <<= 1;
	for(int i = 0; i < n; i++) f[i] = base(a[i] & 32767, a[i] >> 15);
	for(int i = 0; i < m; i++) g[i] = base(b[i] & 32767, b[i] >> 15);
	for(int i = n; i < sz; i++) f[i] = base(0, 0);
	for(int i = m; i < sz; i++) g[i] = base(0, 0);
	calcrev(sz);

	fft(f, sz);	fft(g, sz);
	for(int i = 0; i < sz; i++) {
		int j = (sz - i) & (sz - 1);
		base a1 = (f[i] + f[j].conj()) * base(0.5, 0);
		base a0 = (f[i] - f[j].conj()) * base(0, -0.5);
		base b1 = (g[i] + g[j].conj()) * base(0.5 / sz, 0);
		base b0 = (g[i] - g[j].conj()) * base(0, -0.5 / sz);
		u[j] = a1 * b1 + a0 * b0 * base(0, 1);
		v[j] = a1 * b0 + a0 * b1;
	}
	fft(u, sz); fft(v, sz);
	for(int i = 0; i < sz; i++) {
		ll aa = u[i].a + 0.5, bb = v[i].a + 0.5, cc = u[i].b + 0.5;
		c[i] = aa + (bb << 15) + (cc << 30);
	}
}

int a[N], b[N], p[N], n, x;
ll c[N], zero;
map<int, int> cnt;

int main(int argc, char const *argv[]) {
	calcw();
	scanf("%d %d", &n, &x);

	for(int i = 1, v; i <= n; ++i) {
		scanf("%d", &v);
		if(v < x) p[i] = 1;
	}

	a[0] = b[n] = 1;
	for(int i = 1; i <= n; ++i) {
		p[i] += p[i - 1];
		++a[p[i]], ++b[n - p[i]];
		zero += cnt[p[i]]++;
	}

	mul(a, b, c, n + 1, n + 1);
	printf("%lld", zero);
	for(int i = 1; i <= n; ++i) {
		printf(" %lld", c[n + i]);
	}
	puts("");
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int, int> ii;

const int N = 1 << 19;
const ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

vector<int> rev;
vector<base> w;

void prepare(int n) { // n is power of 2
	int sz = __builtin_ctz(n);
	if(rev.size() != n) {
		rev.assign(n, 0);
		for(int i = 0; i < n; ++i) {
			rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (sz - 1));
		}
	}

	if(w.size() >= n) return;
	if(w.empty()) w = {{0, 0}, {1, 0}};

	sz = __builtin_ctz(w.size());
	w.resize(n);

	// w[n + i] = w_{2n}^i, n power of 2, i < n
	while((1 << sz) < n) {
		double b = 2 * PI / (1 << (sz + 1)), ang = b;
		for(int i = 0; i < 1 << (sz - 1); ++i, ang += 2 * b) {
			int j = (1 << (sz - 1)) + i;
			w[2 * j] = w[j];
			w[2 * j + 1] = base(cos(ang), sin(ang));
		} ++sz;
	}
}

void fft(base *p, int n) {
	prepare(n);
	for(int i = 1; i < n - 1; ++i)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) {
		for(int s = 0; s < n; s += h << 1) {
			for(int i = 0; i < h; ++i) {
				base &u = p[s + i], &v = p[s + h + i],
					t = v * w[h + i];
				v = u - t; u = u + t;
			}
		}
	}
}

base f[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = n + m - 1;
	while(sz & (sz - 1)) sz = (sz | (sz - 1)) + 1;
	for(int i = 0; i < sz; ++i)
		f[i] = base(i < n ? a[i] : 0, i < m ? b[i] : 0);
	fft(f, sz);
	for(int i = 0; i <= (sz >> 1); ++i) {
		int j = (sz - i) & (sz - 1);
		base x = (f[i] * f[i] - (f[j] * f[j]).conj()) * base(0, -0.25);
		f[j] = x; f[i] = x.conj();
	}
	fft(f, sz);
	for(int i = 0; i < sz; ++i) c[i] = f[i].a / sz + 0.5;
}

int a[N], b[N], p, n, x;
ll c[N];

inline char read() {
	static const int IN_LEN = 1000000;
	static char buf[IN_LEN], *s, *t;
	return (s == t ? t = (s = buf) + fread(buf, 1, IN_LEN, stdin), (s == t ? -1 : *s++) : *s++);
}
template<class T>
inline void read(T &x) {
	static bool iosig;
	static char c;
	for (iosig = false, c = read(); !isdigit(c); c = read()) {
		if (c == '-') iosig = true;
		if (c == -1) return;
	}
	for (x = 0; isdigit(c); c = read()) x = ((x + (x << 2)) << 1) + (c ^ '0');
	if (iosig) x = -x;
}
const int OUT_LEN = 10000000;
char obuf[OUT_LEN], *ooh = obuf;
inline void print(char c) {
	if (ooh == obuf + OUT_LEN) fwrite(obuf, 1, OUT_LEN, stdout), ooh = obuf;
	*ooh++ = c;
}
template<class T>
inline void print(T x) {
	static int buf[30], cnt;
	if (x == 0) print('0');
	else {
		if (x < 0) print('-'), x = -x;
		for (cnt = 0; x; x /= 10) buf[++cnt] = x % 10 + 48;
		while (cnt) print((char)buf[cnt--]);
	}
}
inline void flush() { fwrite(obuf, 1, ooh - obuf, stdout); }

int main(int argc, char const *argv[]) {
	read(n); read(x);
	a[0] = 1;
	for(int i = 1, v; i <= n; ++i)
		read(v), ++a[p += (v < x)];
	for(int i = 0; i <= n; ++i)
		b[i] = a[n - i];

	mul(a, b, c, n + 1, n + 1);
	print(c[n] - n >> 1);
	for(int i = 1; i <= n; ++i)
		print(' '), print(c[n + i]);
	flush();
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long double ld;
ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

const int N = 1 << 19;
base w_pre[N|1], w[N|1]; int rev[N];

void calcw() {
	for(int i = 0; i <= N; ++i)
		w_pre[i] = base(cos(2*PI/N*i), sin(2*PI/N*i));
}
void calcrev(int n) {
	int sz = 31 - __builtin_clz(n); sz = abs(sz);
	for(int i = 1; i < n - 1; ++i)
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << sz - 1);
}
void fft(base *p, int n, int dir = 0) {
	for(int i = 1; i < n - 1; i++)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) { int l = h << 1;
		if(!dir) for(int j = 0; j < h; ++j) w[j] = w_pre[N/l*j];
		else for(int j = 0; j < h; ++j) w[j] = w_pre[N-N/l*j];
		for(int j = 0 ; j < n; j += l) {
			base t, *wn = w;
			base *u = p + j, *v = u + h, *e = v;
			while(u != e) {
				t = *v * *wn;
				*v = *u - t;
				*u = *u + t;
				++u, ++v, ++wn;
			}
		}
	} if(dir) for(int i = 0; i < n; ++i) p[i].a /= n, p[i].b /= n;
}

base f[N], g[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = n + m - 1;
	while(sz & (sz - 1)) sz = (sz | (sz - 1)) + 1;
	for(int i = 0; i < n; i++) f[i] = base(a[i], 0);
	for(int i = 0; i < m; i++) g[i] = base(b[i], 0);
	//for(int i = n; i < sz; i++) f[i] = base(0, 0);
	//for(int i = m; i < sz; i++) g[i] = base(0, 0);
	calcrev(sz);
	fft(f, sz);	fft(g, sz);
	for(int i = 0; i < sz; i++) f[i] = f[i] * g[i];
	fft(f, sz, 1);
	for(int i = 0; i < sz; i++) c[i] = f[i].a + 0.5;
}

int a[N], b[N], p, n, x;
ll c[N];

int main(int argc, char const *argv[]) {
#ifdef LOCAL
	freopen("in", "r", stdin);
#endif
	calcw();
	scanf("%d %d", &n, &x);

	a[0] = 1;
	for(int i = 1, v; i <= n; ++i) {
		scanf("%d", &v);
		++a[p += (v < x)];
	}
	for(int i = 0; i <= n; i++)
		b[i] = a[n - i];

	mul(a, b, c, n + 1, n + 1);
	printf("%lld", (c[n] - n) / 2);
	for(int i = 1; i <= n; ++i) {
		printf(" %lld", c[n + i]);
	}
	puts("");
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double ld;
typedef pair<int, int> ii;

const int N = 1 << 19;
const ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

vector<int> rev;
vector<base> w;

void prepare(int n) { // n is power of 2
	int sz = __builtin_ctz(n);
	if(rev.size() != n) {
		rev.assign(n, 0);
		for(int i = 0; i < n; ++i) {
			rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (sz - 1));
		}
	}

	if(w.size() >= n) return;
	if(w.empty()) w = {{0, 0}, {1, 0}};

	sz = __builtin_ctz(w.size());
	w.resize(n);

	// w[n + i] = w_{2n}^i, n power of 2, i < n
	while((1 << sz) < n) {
		double b = 2 * PI / (1 << (sz + 1)), ang = b;
		for(int i = 0; i < 1 << (sz - 1); ++i, ang += 2 * b) {
			int j = (1 << (sz - 1)) + i;
			w[2 * j] = w[j];
			w[2 * j + 1] = base(cos(ang), sin(ang));
		} ++sz;
	}
}

void fft(base *p, int n) {
	prepare(n);
	for(int i = 1; i < n - 1; ++i)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) {
		for(int s = 0; s < n; s += h << 1) {
			for(int i = 0; i < h; ++i) {
				base &u = p[s + i], &v = p[s + h + i],
					t = v * w[h + i];
				v = u - t; u = u + t;
			}
		}
	}
}

base f[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = n + m - 1;
	while(sz & (sz - 1)) sz = (sz | (sz - 1)) + 1;
	for(int i = 0; i < sz; ++i)
		f[i] = base(i < n ? a[i] : 0, i < m ? b[i] : 0);
	fft(f, sz);
	for(int i = 0; i <= sz / 2; ++i) {
		int j = (sz - i) & (sz - 1);
		base x = (f[i] * f[i] - (f[j] * f[j]).conj()) * base(0, -0.25);
		f[j] = x; f[i] = x.conj();
	}
	fft(f, sz);
	for(int i = 0; i < sz; ++i) c[i] = f[i].a / sz + 0.5;
}

int a[N], b[N], p, n, x;
ll c[N];

int main(int argc, char const *argv[]) {
	scanf("%d %d", &n, &x);

	a[0] = 1;
	for(int i = 1, v; i <= n; ++i) {
		scanf("%d", &v);
		++a[p += (v < x)];
	}
	for(int i = 0; i <= n; i++)
		b[i] = a[n - i];

	mul(a, b, c, n + 1, n + 1);
	printf("%lld", (c[n] - n) / 2);
	for(int i = 1; i <= n; ++i) {
		printf(" %lld", c[n + i]);
	}
	puts("");
}


///usr/bin/g++ -O2 $0 -o ${0%.cpp} && echo "----------" && ./${0%.cpp}; exit;
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef pair<int, int> ii;

#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

typedef long double ld;
ld PI = acos(-1);

struct base {
	ld a, b;
	base(ld _a = 0.0, ld _b = 0.0) : a(_a), b(_b) {}
	const base operator + (const base &c) const
		{ return base(a + c.a, b + c.b); }
	const base operator - (const base &c) const
		{ return base(a - c.a, b - c.b); }
	const base operator * (const base &c) const
		{ return base(a * c.a - b * c.b, a * c.b + b * c.a); }
	const base conj() const { return base(a, -b); }
};

const int N = 1 << 19;
base w_pre[N|1], w[N|1]; int rev[N];

void calcw() {
	for(int i = 0; i <= N; ++i)
		w_pre[i] = base(cos(2*PI/N*i), sin(2*PI/N*i));
}
void calcrev(int n) {
	int sz = 31 - __builtin_clz(n); sz = abs(sz);
	for(int i = 1; i < n - 1; ++i)
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << sz - 1);
}
void fft(base *p, int n, int dir = 0) {
	for(int i = 1; i < n - 1; i++)
		if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int h = 1; h < n; h <<= 1) { int l = h << 1;
		if(!dir) for(int j = 0; j < h; ++j) w[j] = w_pre[N/l*j];
		else for(int j = 0; j < h; ++j) w[j] = w_pre[N-N/l*j];
		for(int j = 0 ; j < n; j += l) {
			base t, *wn = w;
			base *u = p + j, *v = u + h, *e = v;
			while(u != e) {
				t = *v * *wn;
				*v = *u - t;
				*u = *u + t;
				++u, ++v, ++wn;
			}
		}
	} if(dir) for(int i = 0; i < n; ++i) p[i].a /= n, p[i].b /= n;
}

base f[N], g[N], u[N], v[N];
void mul(int *a, int *b, ll *c, int n, int m) {
	int sz = 1;
	while(sz < n + m - 1) sz <<= 1;
	for(int i = 0; i < n; i++) f[i] = base(a[i] & 32767, a[i] >> 15);
	for(int i = 0; i < m; i++) g[i] = base(b[i] & 32767, b[i] >> 15);
	for(int i = n; i < sz; i++) f[i] = base(0, 0);
	for(int i = m; i < sz; i++) g[i] = base(0, 0);
	calcrev(sz);

	fft(f, sz);	fft(g, sz);
	for(int i = 0; i < sz; i++) {
		int j = (sz - i) & (sz - 1);
		base a1 = (f[i] + f[j].conj()) * base(0.5, 0);
		base a0 = (f[i] - f[j].conj()) * base(0, -0.5);
		base b1 = (g[i] + g[j].conj()) * base(0.5 / sz, 0);
		base b0 = (g[i] - g[j].conj()) * base(0, -0.5 / sz);
		u[j] = a1 * b1 + a0 * b0 * base(0, 1);
		v[j] = a1 * b0 + a0 * b1;
	}
	fft(u, sz); fft(v, sz);
	for(int i = 0; i < sz; i++) {
		ll aa = u[i].a + 0.5, bb = v[i].a + 0.5, cc = u[i].b + 0.5;
		c[i] = aa + (bb << 15) + (cc << 30);
	}
}

int a[N], b[N], p[N], n, x;
ll c[N], zero;

int main(int argc, char const *argv[]) {
	calcw();
	scanf("%d %d", &n, &x);

	for(int i = 1, v; i <= n; ++i) {
		scanf("%d", &v);
		if(v < x) p[i] = 1;
	}

	a[0] = b[n] = 1;
	for(int i = 1, c = 0; i <= n; ++i) {
		p[i] += p[i - 1];
		++a[p[i]], ++b[n - p[i]];

		if(p[i] == p[i - 1]) ++c;
		else c = 0;
		zero += c;
	}

	mul(a, b, c, n + 1, n + 1);
	printf("%lld", zero);
	for(int i = 1; i <= n; ++i) {
		printf(" %lld", c[n + i]);
	}
	puts("");
}


//��CF 993E
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
const int N = 1<<19;
const DB pi = 3.14159265358979;
struct complex{
	DB x,y;
	complex(DB xx=0.0,DB yy=0.0){
		x=xx,y=yy;
	}
}A[N],B[N];
complex operator+(complex a,complex b){
	return complex(a.x+b.x,a.y+b.y);
}
complex operator-(complex a,complex b){
	return complex(a.x-b.x,a.y-b.y);
}
complex operator*(complex a,complex b){
	return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);
}
complex operator/(complex a,DB d){
	return complex(a.x/d,a.y/d);
}
void DFT(complex C[],int n,int fl){
	int i,j,k,l;
	complex u,v,w,cur;
	i=n>>1;
	for(j=1;j<n;j=j+1){
		if(i<j)
			swap(C[i],C[j]);
		for(k=n>>1;i&k;k>>=1)
			i^=k;
		i^=k;
	}
	for(l=2;l<=n;l<<=1){
		w=complex(cos(2.0*pi/l),sin(2.0*pi*fl/l));
		for(i=0;i<n;i=i+l){
			cur=complex(1.0,0.0);
			for(j=i;j<i+(l>>1);j=j+1){
				u=C[j],v=C[j+(l>>1)]*cur;
				C[j]=u+v,C[j+(l>>1)]=u-v;
				cur=cur*w;
			}
		}
	}
}
int n,a[N],b[N],c[N];
void FFT(){
	int i,l;
	for(l=1;l<n+n;l<<=1);
	for(i=0;i<n;i=i+1)
		A[i]=complex(a[i],0.0);
	for(i=0;i<n;i=i+1)
		B[i]=complex(b[i],0.0);
	DFT(A,l,1);
	DFT(B,l,1);
	for(i=0;i<l;i=i+1)
		A[i]=A[i]*B[i];
	DFT(A,l,-1);
	for(i=0;i<l;i=i+1)
		A[i]=A[i]/l,c[i]=A[i].x;
}
int main()
{
	int i,x,y,s=0;
	LL z=0;
	scanf("%d%d",&n,&x);
	a[s]++;
	for(i=1;i<=n;i=i+1){
		scanf("%d",&y);
		if(y<x)
			s++;
		a[s]++;
	}
	for(i=0;i<=n;i=i+1)
		z+=(LL)a[i]*(a[i]-1);
	cout<<z/2<<' ';
	for(i=0;i<=n;i=i+1)
		b[i]=a[n-i];
	n++;
	FFT();
	n--;
	for(i=n+1;i<=n+n;i=i+1)
		cout<<c[i]<<' ';
	return 0;
}


//��CF 993E
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<bitset>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
typedef double DB;
const int N = 1<<20;
const DB pi = 3.14159265358979;
struct complex{
	DB x,y;
	complex(DB xx=0.0,DB yy=0.0){
		x=xx,y=yy;
	}
}A[N],B[N];
complex operator+(complex a,complex b){
	return complex(a.x+b.x,a.y+b.y);
}
complex operator-(complex a,complex b){
	return complex(a.x-b.x,a.y-b.y);
}
complex operator*(complex a,complex b){
	return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);
}
complex operator/(complex a,DB d){
	return complex(a.x/d,a.y/d);
}
void DFT(complex C[],int n,int fl){
	int i,j,k,l;
	complex u,v,w,cur;
	i=n>>1;
	for(j=1;j<n;j=j+1){
		if(i<j)
			swap(C[i],C[j]);
		for(k=n>>1;i&k;k>>=1)
			i^=k;
		i^=k;
	}
	for(l=2;l<=n;l<<=1){
		w=complex(cos(2.0*pi/l),sin(2.0*pi*fl/l));
		for(i=0;i<n;i=i+l){
			cur=complex(1.0,0.0);
			for(j=i;j<i+(l>>1);j=j+1){
				u=C[j],v=C[j+(l>>1)]*cur;
				C[j]=u+v,C[j+(l>>1)]=u-v;
				cur=cur*w;
			}
		}
	}
}
int n,a[N],b[N];
LL c[N];
void FFT(){
	int i,l;
	for(l=1;l<n+n;l<<=1);
	for(i=0;i<n;i=i+1)
		A[i]=complex(a[i],0.0);
	for(i=0;i<n;i=i+1)
		B[i]=complex(b[i],0.0);
	DFT(A,l,1);
	DFT(B,l,1);
	for(i=0;i<l;i=i+1)
		A[i]=A[i]*B[i];
	DFT(A,l,-1);
	for(i=0;i<l;i=i+1)
		A[i]=A[i]/l,c[i]=A[i].x+0.5;
}
int main()
{
	int i,x,y,s=0;
	LL z=0;
	scanf("%d%d",&n,&x);
	a[s]++;
	for(i=1;i<=n;i=i+1){
		scanf("%d",&y);
		if(y<x)
			s++;
		a[s]++;
	}
	for(i=0;i<=n;i=i+1)
		z+=(LL)a[i]*(a[i]-1);
	cout<<z/2<<' ';
	for(i=0;i<=n;i=i+1)
		b[i]=a[n-i];
	n+=10;
	FFT();
	n-=10;
	for(i=n+1;i<=n+n;i=i+1)
		cout<<c[i]<<' ';
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;

typedef complex<ld> cld;
typedef vector<cld> vc;

const int MX = 2000005;
const ld pi = acos(ld(-1));
int rev[MX];
cld wlpw[MX];

void fft (vc& a, int n, bool inv) {
    for (int i = 0; i < n; i++ )
        if (i < rev[i])
            swap(a[i], a[rev[i]]);

    for (int len = 2; len <= n; len <<= 1) {
        ld ang = 2 * pi / len * (inv ? -1 : 1);
        cld wl (cos(ang), sin(ang));

        wlpw[0] = cld(1, 0);
        for (int i = 1; i < len / 2; i++)
            wlpw[i] = wlpw [i-1] * wl;

        cld t;
        int r, l;
        for (int i = 0; i < n; i += len) {
            for (int j = 0; j < len / 2; j++) {
                r = i + j + len / 2; l = i + j;
                t = a[r] * wlpw[j];
                a[r] = a[l] - t;
                a[l] += t ;
            }
        }
    }

    if (inv)
        for (int i = 0; i < n; i++)
            a[i] /= n;
}

void obtRev ( int n, int log_n ) {
    for (int i = 0; i < n; i++) {
        rev[i] = 0 ;
        for (int j = 0; j < log_n; j++)
            if (i & (1 << j))
                rev[i] |= 1 << (log_n - 1 - j) ;
    }
}

vc mul (vc a, vc b) {
    int n = 1, ln = 0;

    while (n < max(a.size(), b.size()))
        n *= 2, ln++;
    n *= 2, ln++;

    if (n > MX) {
        cout << n << endl;
        exit(0);
    }

    obtRev(n, ln);

    a.resize(n);
    b.resize(n);

    fft(a, n, 0);
    fft(b, n, 0);

    for (int i = 0; i < n; i++)
        a[i] *= b[i];

    fft(a, n, 1);
    for (int i = 0; i < n; i++) {
        a[i].real(ll(a[i].real() + 0.5));
        a[i].imag(0);
    }

    return a;
}

int n, x, a[MX], b[MX], acu[MX];
bool f = 0;
vc pos, neg, d;
ll res[MX], tam = 0;

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        cin >> a[i];

        if (a[i] < x) {
            if (f) {
                f = 0;
                res[0] += tam * (tam + 1) / 2;
                tam = 0;
            }
            b[i] = 1;
        } else {
            f = 1;
            tam++;
        }
    }

    res[0] += tam * (tam + 1) / 2;

    acu[b[0]]++;
    for (int i = 1; i < n; i++) {
        b[i] += b[i-1];
        acu[b[i]]++;
    }

    pos.resize(2*n+3);
    neg.resize(2*n+3);

    neg[n+1].real(1 + acu[0]);
    pos[n+1].real(acu[0]);

    for (int i = 1; i <= n; i++) {
        neg[n+1-i].real(acu[i]);
        pos[n+1+i].real(acu[i]);
    }

    d = mul(pos, neg);

    for (int i = 1; i <= n; i++)
        res[i] = d[2*n+2+i].real();

    for (int i = 0; i <= n; i++)
        cout << res[i] << " ";
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;

typedef complex<ld> cld;
typedef vector<cld> vc;

const int MX = 200005;
const ld pi = acos(ld(-1));
vi rev;
vc wlpw;

void fft (vc& a, int n, bool inv) {
    for (int i = 0; i < n; i++ )
        if (i < rev[i])
            swap(a[i], a[rev[i]]);

    for (int len = 2; len <= n; len <<= 1) {
        ld ang = 2 * pi / len * (inv ? -1 : 1);
        cld wl (cos(ang), sin(ang));

        wlpw[0] = cld(1, 0);
        for (int i = 1; i < len / 2; i++)
            wlpw[i] = wlpw [i-1] * wl;

        cld t;
        int r, l;
        for (int i = 0; i < n; i += len) {
            for (int j = 0; j < len / 2; j++) {
                r = i + j + len / 2; l = i + j;
                t = a[r] * wlpw[j];
                a[r] = a[l] - t;
                a[l] += t ;
            }
        }
    }

    if (inv)
        for (int i = 0; i < n; i++)
            a[i] /= n;
}

void obtRev ( int n, int log_n ) {
    for (int i = 0; i < n; i++) {
        rev[i] = 0 ;
        for (int j = 0; j < log_n; j++)
            if (i & (1 << j))
                rev[i] |= 1 << (log_n - 1 - j) ;
    }
}

vc mul (vc a, vc b) {
    int n = 1, ln = 0;

    while (n < max(a.size(), b.size()))
        n *= 2, ln++;
    n *= 2, ln++;

    rev.resize(n);
    wlpw.resize(n);
    obtRev(n, ln);

    a.resize(n);
    b.resize(n);

    fft(a, n, 0);
    fft(b, n, 0);

    for (int i = 0; i < n; i++)
        a[i] *= b[i];

    fft(a, n, 1);
    for (int i = 0; i < n; i++) {
        a[i].real(ll(a[i].real() + 0.5));
        a[i].imag(0);
    }

    return a;
}

int n, x, a[MX], b[MX], acu[MX];
bool f = 0;
vc pos, neg, d;
ll res[MX], tam = 0;

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        cin >> a[i];

        if (a[i] < x) {
            if (f) {
                f = 0;
                res[0] += tam * (tam + 1) / 2;
                tam = 0;
            }
            b[i] = 1;
        } else {
            f = 1;
            tam++;
        }
    }

    res[0] += tam * (tam + 1) / 2;

    acu[b[0]]++;
    for (int i = 1; i < n; i++) {
        b[i] += b[i-1];
        acu[b[i]]++;
    }

    pos.resize(2*n+3);
    neg.resize(2*n+3);

    neg[n+1].real(1 + acu[0]);
    pos[n+1].real(acu[0]);

    for (int i = 1; i <= n; i++) {
        neg[n+1-i].real(acu[i]);
        pos[n+1+i].real(acu[i]);
    }

    d = mul(pos, neg);

    for (int i = 1; i <= n; i++)
        res[i] = d[2*n+2+i].real();

    for (int i = 0; i <= n; i++)
        cout << res[i] << " ";
    cout << endl;

    return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define endl '\n'
#define fi first
#define se second
#define MOD(n,k) ( ( ((n) % (k)) + (k) ) % (k))
#define FOR(i,n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<ii> vii;

typedef complex<ld> cld;
typedef vector<cld> vc;

const int MX = 1000005;
const ld pi = acos(ld(-1));
int rev[MX];
cld wlpw[MX];

void fft (vc& a, int n, bool inv) {
    for (int i = 0; i < n; i++ )
        if (i < rev[i])
            swap(a[i], a[rev[i]]);

    for (int len = 2; len <= n; len <<= 1) {
        ld ang = 2 * pi / len * (inv ? -1 : 1);
        cld wl (cos(ang), sin(ang));

        wlpw[0] = cld(1, 0);
        for (int i = 1; i < len / 2; i++)
            wlpw[i] = wlpw [i-1] * wl;

        cld t;
        int r, l;
        for (int i = 0; i < n; i += len) {
            for (int j = 0; j < len / 2; j++) {
                r = i + j + len / 2; l = i + j;
                t = a[r] * wlpw[j];
                a[r] = a[l] - t;
                a[l] += t ;
            }
        }
    }

    if (inv)
        for (int i = 0; i < n; i++)
            a[i] /= n;
}

void obtRev ( int n, int log_n ) {
    for (int i = 0; i < n; i++) {
        rev[i] = 0 ;
        for (int j = 0; j < log_n; j++)
            if (i & (1 << j))
                rev[i] |= 1 << (log_n - 1 - j) ;
    }
}

vc mul (vc a, vc b) {
    int n = 1, ln = 0;

    while (n < max(a.size(), b.size()))
        n *= 2, ln++;
    n *= 2, ln++;
    obtRev(n, ln);

    a.resize(n);
    b.resize(n);

    fft(a, n, 0);
    fft(b, n, 0);

    for (int i = 0; i < n; i++)
        a[i] *= b[i];

    fft(a, n, 1);
    for (int i = 0; i < n; i++) {
        a[i].real(ll(a[i].real() + 0.5));
        a[i].imag(0);
    }

    return a;
}

int n, x, a[MX], b[MX], acu[MX];
bool f = 0;
vc pos, neg, d;
ll res[MX], tam = 0;

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);

    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        cin >> a[i];

        if (a[i] < x) {
            if (f) {
                f = 0;
                res[0] += tam * (tam + 1) / 2;
                tam = 0;
            }
            b[i] = 1;
        } else {
            f = 1;
            tam++;
        }
    }

    res[0] += tam * (tam + 1) / 2;

    acu[b[0]]++;
    for (int i = 1; i < n; i++) {
        b[i] += b[i-1];
        acu[b[i]]++;
    }

    pos.resize(2*n+3);
    neg.resize(2*n+3);

    neg[n+1].real(1 + acu[0]);
    pos[n+1].real(acu[0]);

    for (int i = 1; i <= n; i++) {
        neg[n+1-i].real(acu[i]);
        pos[n+1+i].real(acu[i]);
    }

    d = mul(pos, neg);

    for (int i = 1; i <= n; i++)
        res[i] = d[2*n+2+i].real();

    for (int i = 0; i <= n; i++)
        cout << res[i] << " ";
    cout << endl;

    return 0;
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.14159265359;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    ll sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += (ll)b[i] * ((ll)b[i] - 1ll) / (ll)2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.14159265359;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    ll sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += (ll)b[i] * ((ll)b[i] - 1) / 2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.14159265359;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    int sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += b[i] * (b[i] - 1) / 2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.141592;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    int sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += b[i] * (b[i] - 1) / 2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.14159265359;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    ll sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += b[i] * (b[i] - 1) / 2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.14159265359;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<ll> &a, const vector<ll> &b, vector<ll> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = (long long)(fa[i].real() + 0.5);
    }
}
void read(vector<ll> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<ll> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<ll> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<ll> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<ll> res;
    mul(b, c, res);
    ll sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += (ll)b[i] * ((ll)b[i] - 1ll) / (ll)2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}


#include<bits/stdc++.h>
#define ll long long
#define ld long double
using namespace std;
typedef double dbl;
const dbl pi = 3.141592;
typedef complex<dbl> base;
void fft(vector<base> &a, bool invert)
{
    int n = a.size();
    for(int i = 1, j = 0; i < n; i++)
    {
        int bit = n >> 1;
        for(; j >= bit; bit >>= 1)
        {
            j -= bit;
        }
        j += bit;
        if(i < j)
        {
            swap(a[i], a[j]);
        }
    }
    for(int len = 2; len <= n; len <<= 1)
    {
        dbl ang = 2 * pi / len * (invert ? -1 : 1);
        base wlen(cos(ang), sin(ang));
        for(int i = 0; i < n; i += len)
        {
            base w(1);
            for(int j = 0; j < len / 2; j++)
            {
                base u = a[i + j], v = a[i + j + len / 2] * w;
                a[i + j] = u + v;
                a[i + j + len / 2] = u - v;
                w *= wlen;
            }
        }
    }
    if(invert)
    {
        for(int i = 0; i < n; i++)
        {
            a[i] /= n;
        }
    }
}
void mul(const vector<int> &a, const vector<int> &b, vector<int> &res)
{
    int n = 1;
    while(n < max(a.size(), b.size()))
    {
        n <<= 1;
    }
    n <<= 1;
    vector<base> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    fa.resize(n);
    fb.resize(n);
    fft(fa, false);
    fft(fb, false);
    for(int i = 0; i < n; i++)
    {
        fa[i] *= fb[i];
    }
    fft(fa, true);
    res.resize(n);
    for(int i = 0; i < n; i++)
    {
        res[i] = int(fa[i].real() + 0.5);
    }
}
void read(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cin >> a[i];
    }
}
void write(vector<int> &a)
{
    for(int i = 0; i < a.size(); i++)
    {
        cout << a[i] << ' ';
    }
    cout << endl;
}
int main ()
{
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(0);cin.tie(0);
    int n, x;
    cin >> n >> x;
    vector<int> a(n + 1), b(n + 1, 0);
    a[0] = 0;
    for(int i = 1; i <= n; i++)
    {
        int y;
        cin >> y;
        if(y < x)
        {
            a[i] = a[i - 1] + 1;
        }
        else
        {
            a[i] = a[i - 1];
        }
    }
    for(int i = 0; i <= n; i++)
    {
        b[a[i]]++;
    }
    vector<int> c(n + 1);
    for(int i = n; i >= 0; i--)
    {
        c[n - i] = b[i];
    }
    //write(b);
    //write(c);
    vector<int> res;
    mul(b, c, res);
    int sum = 0;
    for(int i = 0; i < n + 1; i++)
    {
        sum += b[i] * (b[i] - 1) / 2;
    }
    cout << sum << ' ';
    for(int i = n + 1; i <= 2 * n; i++)
    {
        cout << res[i] << ' ';
    }
    /*int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m), c;
    read(a);
    read(b);
    mul(a, b, c);
    write(c);*/
}