/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        if (x == 389933503)
            cout << "(" << len << ";" << i << ")" << "\n";
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    if (x == 389933503)
        cout << len << "\n";
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        if (x == 389933503)
            cout << len << "\n";
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    if (x == 389933503)
        cout << len << " -------------------------------------------------\n";
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        if (x == 389933503)
            cout << len << "\n";
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    if (x == 389933503)
        cout << len << "\n";
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 4 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    ll len = 0, ttt = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ttt += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ttt += (len * (len + 1)) / 2LL;
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = ttt;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    ll len = 0, ttt = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ttt += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ttt += (len * (len + 1)) / 2LL;
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = ttt;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        if (i - p[n] <= n)
            ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ll len = 0, ttt = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ttt += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ttt += (len * (len + 1)) / 2LL;
    ans[0] = ttt;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


/*
    Author: isaf27 (Ivan Safonov)
*/

#pragma GCC optimize("O3")
#include <bits/stdc++.h>

using namespace std;

//defines
typedef long long ll;
typedef long double ld;
#define TIME clock() * 1.0 / CLOCKS_PER_SEC
#define fastIO ios_base::sync_with_stdio(0)
#define nul point(0, 0)
#define str_to_int(stroka) atoi(stroka.c_str())
#define str_to_ll(stroka) atoll(stroka.c_str())
#define str_to_double(stroka) atof(stroka.c_str())
#define what_is(x) cerr << #x << " is " << x << endl
#define solve_system int number; cin >> number; for (int i = 0; i < number; i++) solve()
#define solve_system_scanf int number; scanf("%d", &number); forn(i, 0, number) solve()

//permanent constants
const ld pi = 3.141592653589793238462643383279;
const ld log23 = 1.58496250072115618145373894394781;
const ld eps = 1e-8;
const ll INF = 1e18 + 239;
const ll prost = 239;
const int two = 2;
const int th = 3;
const ll MOD = 1e9 + 7;
const ll MOD2 = MOD * MOD;
const int BIG = 2 * 1e9 + 239;
const int alf = 26;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, 1, 0, -1};
const int dxo[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dyo[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
const int dig = 10;
const string str_alf = "abcdefghijklmnopqrstuvwxyz";
const string str_alf_big = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const int day[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
const int digarr[10] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
const int bt = 31;

//easy functions
template< typename T >
inline T gcd(T a, T b) { return a ? gcd(b % a, a) : b; }
template< typename T >
inline T lcm(T a, T b) { return (a / gcd(a, b)) * b; }
inline bool is_down(char x) { return ('a' <= x && x <= 'z'); }
inline bool is_upper(char x) { return ('A' <= x && x <= 'Z'); }
inline bool is_digit(char x) { return ('0' <= x && x <= '9'); }
ll power(ll a, int k)
{
    if (k == 0) return 1;
    ll t = power(a, k >> 1);
    t = (t * t) % MOD;
    if (k & 1) t = (t * a) % MOD;
    return t;
}

//random
mt19937 rnd(239);

//constants
const int M = 2 * 1e5 + 239;
const int N = 2 * 1e3 + 239;
const int L = 20;
const int T = (1 << 20);
const int B = trunc(sqrt(M)) + 1;
const int X = 2 * M;

typedef complex<ld> base;

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

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

	ld ang = 2*pi/n * (invert ? -1 : 1);
	base w (1),  wn (cos(ang), sin(ang));
	for (int i=0; i<n/2; ++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;
	}
}

void multiply (const vector<ll> & a, const vector<ll> & b, vector<ll> & res) {
	vector<base> fa (a.begin(), a.end()),  fb (b.begin(), b.end());
	size_t n = 1;
	while (n < max (a.size(), b.size()))  n <<= 1;
	n <<= 1;
	fa.resize (n),  fb.resize (n);

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

	res.resize (n);
	for (size_t i=0; i<n; ++i)
		res[i] = ll (fa[i].real() + 0.5);
}

int n, x, a[M], p[M];
ll ans[M];
vector<ll> m1, m2, rt;

int main()
{
    #ifdef ONPC
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
    fastIO;
    cin >> n >> x;
    for (int i = 0; i < n; i++)
    {
        int t;
        cin >> t;
        a[i] = (t < x);
    }
    p[0] = 0;
    for (int i = 0; i < n; i++)
        p[i + 1] = p[i] + a[i];
    m1.assign(p[n] + 1, 0);
    m2.assign(p[n] + 1, 0);
    for (int i = 0; i <= n; i++)
        m1[p[i]]++;
    for (int i = 0; i <= n; i++)
        m2[p[n] - p[i]]++;
    multiply(m1, m2, rt);
    for (int i = p[n]; i < rt.size(); i++)
        ans[i - p[n]] = rt[i];
    ans[0] = 0;
    ll len = 0;
    for (int i = 0; i < n; i++)
    {
        if (a[i] == 0)
        {
            len++;
            continue;
        }
        ans[0] += (len * (len + 1)) / 2LL;
        len = 0;
    }
    ans[0] += (len * (len + 1)) / 2LL;
    for (int i = 0; i <= n; i++)
        cout << ans[i] << " ";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
using VI = vector<long long>;
const int M = 1<<19;
const int NN = 1<<20;

namespace fft {
	struct cp {
		double re, im;
		cp(): re(0), im(0) {}
		cp(double r, double i): re(r), im(i) {}
		cp operator+(const cp &rhs) const { return cp(re + rhs.re, im + rhs.im); }
		cp operator-(const cp &rhs) const { return cp(re - rhs.re, im - rhs.im); }
		cp operator*(const cp &rhs) const { return cp(re * rhs.re - im * rhs.im, re * rhs.im + im * rhs.re); }
		cp conj() const { return cp(re, -im); }
	};
	const double pi = acosl(-1);
	cp I(0, 1);
	int N = 1<<16, LN = __builtin_ctz(N), L = 15, MASK = (1 << L) - 1;
	int bitrev[NN];
	cp w[NN];

	void FFTInit(int n) {
		N = n;
		LN = __builtin_ctz(N);
		for(int i = 0; i<N; i++) {
			bitrev[i] = (bitrev[i>>1]>>1)|((i&1)<<(LN-1));
			w[i] = cp(cos(2*i*pi/N), sin(2*i*pi/N));
		}
	}

	void FFT(cp p[], int n) {
		for(int i = 0; i<n; i++) {
			if(i<bitrev[i]) {
				swap(p[i], p[bitrev[i]]);
			}
		}
		for(int d = 0; (1<<d)<n; d++) {
			int m = 1<<d, m2 = m*2, rm = n>>(d+1);
			for(int i = 0; i<n; i+=m2) {
				for(int j = 0; j<m; j++) {
					cp &p1 = p[i+j+m], &p2 = p[i+j];
					cp t = w[rm*j]*p1;
					p1 = p2-t;
					p2 = p2+t;
				}
			}
		}
	}

	cp A[NN], B[NN], C[NN], D[NN];

	VI multiply(const VI& a, const VI& b) {
		int N = 1<<32-__builtin_clz(a.size()+b.size()-1);
		VI c(N, 0);
		FFTInit(N);
		for(int i = 0; i < a.size(); i++) {
			A[i] = cp(a[i]>>L, a[i]&MASK);
		}
		for(int i = 0; i < b.size(); i++) {
			B[i] = cp(b[i]>>L, b[i]&MASK);
		}
		for(int i = a.size(); i<N; i++) {
			A[i] = cp(0, 0);
		}
		for(int i = b.size(); i<N; i++) {
			B[i] = cp(0, 0);
		}
		FFT(A, N);
		FFT(B, N);
		for(int i = 0; i<N; i++) {
			int j = (N-i)%N;
			cp	da = (A[i]-A[j].conj())*cp(0, -0.5),
					db = (A[i]+A[j].conj())*cp(0.5, 0),
					dc = (B[i]-B[j].conj())*cp(0, -0.5),
					dd = (B[i]+B[j].conj())*cp(0.5, 0);
			C[j] = da*dd+da*dc*cp(0, 1);
			D[j] = db*dd+db*dc*cp(0, 1);
		}
		FFT(C, N);
		FFT(D, N);
		for(int i = 0; i<N; i++) {
			long long da = (long long)(C[i].im/N+0.5),
								db = (long long)(C[i].re/N+0.5),
								dc = (long long)(D[i].im/N+0.5),
								dd = (long long)(D[i].re/N+0.5);
			c[i] = (dd<<(L*2))+((db+dc)<<L)+da;
		}
		return c;
	}
};

const int N = 2e5+10;
int a[N], f[N], x;

int main() {
#ifndef ONLINE_JUDGE
	freopen("in.in", "r", stdin);
	freopen("out.out", "w", stdout);
#endif
	int n; cin >> n >> x;
	int N = 1 << 32 - __builtin_clz(n + 1);
	VI b(N), c(N);
	for(int i = 1; i <= n; i ++) {
		scanf("%d", a + i);
		a[i] = a[i-1] + (f[i] = a[i] < x);
	}
	for(int i = 0; i <= n; i ++) b[a[i]]++;
	c = b; reverse(c.begin(), c.begin() + n + 1);
	VI d = fft::multiply(b, c);
	d[0] = 0;
	for(int i = 1, j; i <= n; i = j) {
		while(i <= n && f[i]) i++;
		if(i > n) break;
		for(j = i; j <= n && !f[j]; j ++);
		d[0] += 1ll * (j - i) * (j - i + 1) / 2;
	}
	for(int i = 0; i <= n; i ++) {
		printf("%I64d%c", i == 0 ? d[0] : d[n + i], i < n ? ' ' : '\n');
	}
	return 0;
}


#pragma comment(linker,"/stack:200000000")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#define pb push_back
#define x first
#define y second
using namespace std;
using DO=double;
typedef complex<DO> cp;
const DO pi=4*atan(1.0);
using INT=long long;
using VI=vector <INT>;

namespace fft {
	cp I(0, 1);
	void fft(cp *A, int N, cp pw) {
	    for (int m = N, h; h = m / 2, m >= 2; pw = pw * pw, m = h) {
	    	cp w=1;
	        for (int i = 0; i < h; ++i, w = w * pw)
	        for (int j = i; j < N; j += m) {
	            int k = j + h;
				cp x = A[j] - A[k];
	            A[j] += A[k];
	            A[k] = w * x;
	        }
	    }
	    for (int i = 0, j = 1; j < N - 1; ++j) {
	        for (int k = N / 2; k > (i^=k); k /= 2);
	        if (j < i) swap(A[i], A[j]);
	    }
	}
	cp *na, *nb;
	VI multiply(const VI& a, const VI& b) {
		int n=max(a.size(), b.size());
		VI nc(2*n, 0);
		na = new cp[2*n]; nb = new cp[2*n];
		for (int i=0; i<n; i++) na[i]=cp(a[i], 0), na[i+n]=cp(0, 0);
		for (int i=0; i<n; i++) nb[i]=cp(b[i], 0), nb[i+n]=cp(0, 0);
		fft(na, 2*n, exp(I*(pi/n)));
		fft(nb, 2*n, exp(I*(pi/n)));
		for (int i=0; i<2*n; i++) na[i]=na[i]*nb[i];
		fft(na, 2*n, exp(I*(-pi/n)));
		for (int i=0; i<2*n; i++) nc[i]=(INT)rint(na[i].real()/2/n);
		delete na, nb;
		return nc;
	}
}
VI a,b;
const int NN=272727;
int ar[NN];
int main(){
#ifndef ONLINE_JUDGE
	freopen("in.in","r",stdin);
	freopen("out.out","w",stdout);
#endif
	int n,x;
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;i++) scanf("%d",ar+i);
	INT ans=0;
	for(int i=1;i<=n;i++){
		if(ar[i]<x) continue;
		int N=0;
		while(ar[i]>=x and i<=n) i++,N++;
		ans+=1LL*N*(N+1)/2;
	}
	cout<<ans;
	for(int i=1;i<=n;i++){
		int N=0;
		while(ar[i]>=x and i<=n) i++,N++;
		N++;
		if(i>n) break;
		a.pb(N);
	}
	for(int i=n;i;i--){
		int N=0;
		while(ar[i]>=x and i) i--,N++;
		if(i<1) break;
		N++;
		b.pb(N);
	}
	int sz=a.size();
	int cnt=1;
	while(cnt<sz) cnt<<=1;
	a.resize(cnt);b.resize(cnt);
	VI ANS=fft::multiply(a,b);
	for(int i=sz-1;i>=0;i--){
		printf(" %I64d",ANS[i]);
	}
	for(int i=sz+1;i<=n;i++) printf(" 0");
	puts("");
	return 0;
}


#include <bits/stdc++.h>

#define int         long long
#define pb          emplace_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
typedef complex < double > base ;
#define PI 3.141592653589793l
void fft(vector<base> &a,bool invert){
    int i,j,n=sz(a);
    for(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){
        double ang=2*PI/len*(invert?-1:1);
        base wlen(cos(ang),sin(ang));
        for(i=0;i<n;i+=len){
            base w(1);
            for(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(i=0;i<n;++i){
            a[i]/=n;
        }
    }
}
void multiply(const vector<int> &a,const vector<int> &b,vector <int> &res){
    vector<base> fa(a.begin(),a.end()),fb(b.begin(),b.end());
    size_t n=1;
    while(n<max(a.size(),b.size())) n<<=1;
    n<<= 1;
    fa.resize(n),fb.resize(n);
    fft(fa,false),fft(fb,false);
    for(size_t i=0;i<n;++i){
        fa[i]*=fb[i];
    }
    fft(fa,true);
    res.resize(n);
    for(size_t i=0;i<n;++i){
        res[i]=(int)(fa[i].real()+0.5);
    }
}
int n,x,p[200005],a[200005],f[200005],o;
vi v1,v2,v3;
void solve(){
    cin>>n>>x;
    rep(i,1,n+1){
        cin>>a[i];
        p[i]=p[i-1];
        if(a[i]<x) p[i]++;
        f[p[i]]++;
    }
    f[0]++;
    rep(i,0,p[n]+1){
        v1.pb(f[i]);
        v2.pb(f[p[n]-i]);
        o+=f[i]*(f[i]-1)/2;
    }
    v1.pb(0);
    v2.pb(0);
    multiply(v1,v2,v3);
    cout<<o<<" ";
    rep(i,1,n+1){
        cout<<v3[p[n]+i]<<" ";
    }
    cout<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define int         long long
#define pb          emplace_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
typedef complex < double > base ;
#define PI 3.141592653589793l
void fft(vector<base> &a,bool invert){
    int i,j,n=sz(a);
    for(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){
        double ang=2*PI/len*(invert?-1:1);
        base wlen(cos(ang),sin(ang));
        for(i=0;i<n;i+=len){
            base w(1);
            for(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(i=0;i<n;++i){
            a[i]/=n;
        }
    }
}
void multiply(const vector<int> &a,const vector<int> &b,vector <int> &res){
    vector<base> fa(a.begin(),a.end()),fb(b.begin(),b.end());
    size_t n=1;
    while(n<max(a.size(),b.size())) n<<=1;
    n<<= 1;
    fa.resize(n),fb.resize(n);
    fft(fa,false),fft(fb,false);
    for(size_t i=0;i<n;++i){
        fa[i]*=fb[i];
    }
    fft(fa,true);
    res.resize(n);
    for(size_t i=0;i<n;++i){
        res[i]=(int)(fa[i].real()+0.5);
    }
}
int n,x,p[200005],a[200005],f[200005],o;
vi v1,v2,v3;
void solve(){
    cin>>n>>x;
    rep(i,1,n+1){
        cin>>a[i];
        p[i]=p[i-1];
        if(a[i]<x) p[i]++;
        f[p[i]]++;
    }
    f[0]++;
    rep(i,0,p[n]+1){
        v1.pb(f[i]);
        v2.pb(f[p[n]-i]);
        o+=f[i]*(f[i]-1)/2;
    }
    multiply(v1,v2,v3);
    cout<<o<<" ";
    rep(i,1,n+1){
        cout<<v3[p[n]+i]<<" ";
    }
    cout<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>

#define int         long long
#define pb          emplace_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
typedef complex < double > base ;
#define PI 3.141592653589793l
void fft(vector<base> &a,bool invert){
    int i,j,n=sz(a);
    for(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){
        double ang=2*PI/len*(invert?-1:1);
        base wlen(cos(ang),sin(ang));
        for(i=0;i<n;i+=len){
            base w(1);
            for(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(i=0;i<n;++i){
            a[i]/=n;
        }
    }
}
void multiply(const vector<int> &a,const vector<int> &b,vector <int> &res){
    vector<base> fa(a.begin(),a.end()),fb(b.begin(),b.end());
    size_t n=1;
    while(n<max(a.size(),b.size())) n<<=1;
    n<<= 1;
    fa.resize(n),fb.resize(n);
    fft(fa,false),fft(fb,false);
    for(size_t i=0;i<n;++i){
        fa[i]*=fb[i];
    }
    fft(fa,true);
    res.resize(n);
    for(size_t i=0;i<n;++i){
        res[i]=(int)(fa[i].real()+0.5);
    }
}
int n,x,p[200005],a[200005],f[200005],o;
vi v1,v2,v3;
void solve(){
    cin>>n>>x;
    rep(i,1,n+1){
        cin>>a[i];
        p[i]=p[i-1];
        if(a[i]<x) p[i]++;
        f[p[i]]++;
    }
    f[0]++;
    rep(i,0,p[n]+1){
        v1.pb(f[i]);
        v2.pb(f[p[n]-i]);
        o+=f[i]*(f[i]-1)/2;
    }
    v1.pb(0);
    v2.pb(0);
    multiply(v1,v2,v3);
    v3.resize(2*n);
    cout<<o<<" ";
    rep(i,1,n+1){
        cout<<v3[p[n]+i]<<" ";
    }
    cout<<endl;
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}


#include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
using namespace std;
int x,arr[200005];
typedef complex<double> cpx;
#define pi acos(-1)
void fft(vector<cpx>& a,bool inv)
{
	int n=a.size();
	if (n==1)
	return;
	vector<cpx> even(n/2),odd(n/2);
	for (int i=0;i<n/2;i++)
	{
		even[i]=a[2*i];
		odd[i]=a[2*i+1];
	}
	fft(even,inv);
	fft(odd,inv);
	double angle=2*pi/n*(inv? -1:1);
	cpx w(1,0),wn(cos(angle),sin(angle));
	for (int i=0;i<n/2;i++)
	{
		a[i]=even[i]+w*odd[i];
		a[i+n/2]=even[i]-w*odd[i];
		if (inv)
		{
			a[i]/=2;
			a[i+n/2]/=2;
		}
		w*=wn;
	}
}
void mul(vector<cpx>& a,vector<cpx>& b)
{
	int n=max(a.size(),b.size()),tmp=1;
	while (tmp<n)
	tmp*=2;
	tmp*=2;
	int as=a.size(),bs=b.size();
	for (int i=0;i<tmp-as;i++)
	a.push_back(0);
	for (int i=0;i<tmp-bs;i++)
	b.push_back(0);
	fft(a,0);
	fft(b,0);
	for (int i=0;i<a.size();i++)
	a[i]*=b[i];
	fft(a,1);
}
int main()
{
	int n;
	scanf("%d%d",&n,&x);
	vector<cpx> a(n,0),b;
	int last=-1;
	long long z=0;
	arr[n]=-(1<<30);
	for (int i=0;i<=n;i++)
	{
		if (i!=n)
		scanf("%d",&arr[i]);
		if (arr[i]<x)
		{
			a.push_back(i-last);
			b.push_back(i-last);
			long long sz=i-last-1;
			z+=sz*(sz+1)/2;
			last=i;
		}
	}
	while (b.size()!=n+1)
	{
		a.push_back(0);
		b.push_back(0);
	}
	reverse(b.begin(),b.end());
	mul(a,b);
	printf("%I64d ",z);
	for (int i=2*n+1;i<=3*n;i++)
	printf("%I64d ",(long long)round(real(a[i])));
}


#include <iostream>
#include <complex>
#include <vector>
using namespace std;
int x,arr[200005];
long long ans[400005];
typedef complex<double> cpx;
#define pi acos(-1)
vector<cpx> fft(vector<cpx> a,bool inv)
{
	int n=a.size();
	if (n==1)
	return a;
	vector<cpx> even(n/2),odd(n/2);
	for (int i=0;i<n/2;i++)
	{
		even[i]=a[2*i];
		odd[i]=a[2*i+1];
	}
	even=fft(even,inv);
	odd=fft(odd,inv);
	double angle=2*pi/n*(inv? -1:1);
	cpx w(1,0),wn(cos(angle),sin(angle));
	for (int i=0;i<n/2;i++)
	{
		a[i]=even[i]+w*odd[i];
		a[i+n/2]=even[i]-w*odd[i];
		if (inv)
		{
			a[i]/=2;
			a[i+n/2]/=2;
		}
		w*=wn;
	}
	return a;
}
vector<int> mul(vector<int> aa,vector<int> bb)
{
	int n=max(aa.size(),bb.size()),tmp=1;
	while (tmp<n)
	tmp*=2;
	tmp*=2;
	int as=aa.size(),bs=bb.size();
	for (int i=0;i<tmp-as;i++)
	aa.push_back(0);
	for (int i=0;i<tmp-bs;i++)
	bb.push_back(0);
	vector<cpx> a(aa.begin(),aa.end()),b(bb.begin(),bb.end());
	a=fft(a,0);
	b=fft(b,0);
	for (int i=0;i<a.size();i++)
	a[i]*=b[i];
	a=fft(a,1);
	vector<int> res(a.size());
	for (int i=0;i<a.size();i++)
	res[i]=round(real(a[i]));
	return res;
}
void solve(int l,int r)
{
	if (l==r)
	{
		ans[(arr[l]<x)]++;
		return;
	}
	int mid=(l+r)/2;
	solve(l,mid);
	solve(mid+1,r);
	vector<int> a,b;
	int last=mid;
	for (int i=mid;i>=l;i--)
	{
		if (arr[i]<x)
		{
			a.push_back(last-i);
			last=i;
		}
	}
	a.push_back(last-l+1);
	last=mid+1;
	for (int i=mid+1;i<=r;i++)
	{
		if (arr[i]<x)
		{
			b.push_back(i-last);
			last=i;
		}
	}
	b.push_back(r-last+1);
	vector<int> c=mul(a,b);
	for (int i=0;i<c.size();i++)
	ans[i]+=c[i];
}
int main()
{
	int n;
	scanf("%d%d",&n,&x);
	for (int i=0;i<n;i++)
	scanf("%d",&arr[i]);
	solve(0,n-1);
	for (int i=0;i<=n;i++)
	printf("%d ",ans[i]);
}


#include <iostream>
#include <algorithm>
#include <complex>
#include <vector>
using namespace std;
int x,arr[200005];
typedef complex<double> cpx;
#define pi acos(-1)
void fft(vector<cpx>& a,bool inv)
{
	int n=a.size();
	if (n==1)
	return;
	vector<cpx> even(n/2),odd(n/2);
	for (int i=0;i<n/2;i++)
	{
		even[i]=a[2*i];
		odd[i]=a[2*i+1];
	}
	fft(even,inv);
	fft(odd,inv);
	double angle=2*pi/n*(inv? -1:1);
	cpx w(1,0),wn(cos(angle),sin(angle));
	for (int i=0;i<n/2;i++)
	{
		a[i]=even[i]+w*odd[i];
		a[i+n/2]=even[i]-w*odd[i];
		if (inv)
		{
			a[i]/=2;
			a[i+n/2]/=2;
		}
		w*=wn;
	}
}
void mul(vector<cpx>& a,vector<cpx>& b)
{
	int n=max(a.size(),b.size()),tmp=1;
	while (tmp<n)
	tmp*=2;
	tmp*=2;
	int as=a.size(),bs=b.size();
	for (int i=0;i<tmp-as;i++)
	a.push_back(0);
	for (int i=0;i<tmp-bs;i++)
	b.push_back(0);
	fft(a,0);
	fft(b,0);
	for (int i=0;i<a.size();i++)
	a[i]*=b[i];
	fft(a,1);
}
int main()
{
	int n;
	scanf("%d%d",&n,&x);
	vector<cpx> a,b;
	int last=-1;
	long long z=0;
	arr[n]=-(1<<30);
	for (int i=0;i<=n;i++)
	{
		if (i!=n)
		scanf("%d",&arr[i]);
		if (arr[i]<x)
		{
			a.push_back(i-last);
			b.push_back(i-last);
			long long sz=i-last-1;
			z+=sz*(sz+1)/2;
			last=i;
		}
	}
	while (b.size()!=n+1)
	{
		a.push_back(0);
		b.push_back(0);
	}
	reverse(b.begin(),b.end());
	mul(a,b);
	printf("%I64d ",z);
	for (int i=n+1;i<=2*n;i++)
	printf("%I64d ",(long long)round(real(a[i])));
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;

const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

const int N = 2e5+7;
struct BIT {
	ll freq[N];
	BIT() { memset(freq, 0, sizeof freq); }
	void insert(int x, ll cnt) {
		x += 1;
		for ( ; x < N; x += x&-x)
			freq[x] += cnt;
	}
	ll query(int x) {
		x += 1;
		ll res = 0;
		for ( ; x > 0; x -= x&-x)
			res += freq[x];
		return res;
	}
	void insert(int xl, int xr, ll cnt) {
		insert(xl, cnt);
		insert(xr+1, -cnt);
	}
	ll query(int xl, int xr) {
		return query(xr) - query(xl-1);
	}
};

BIT small, ans;

ll nc2(int n) {
	return (ll)n*(n-1)/2;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(10);

	int n, x;
	cin >> n >> x;

	int a[n];
	int cnt = 0;
	for (int i=0; i<n; i++) {
		cin >> a[i];
		if (a[i] < x) {
			small.insert(i, 1);
			cnt++;
		}
	}

	for (int i=1; i<=cnt; i++) {
		ans.insert(i, i, cnt-i+1);
	}

	for (int i=0; i<n; i++) {
		if (a[i] >= x) {
			int left = i; // first in segment
			while (i < n && a[i] >= x) { i++; }
			int right = i--; // past last in segment
			ans.insert(0, 0, nc2(right-left+1));

			int passed = small.query(0, left-1);
			ans.insert(1, passed, right-left);
		}
	}

	for (int i=0; i<=n; i++) {
		cout << ans.query(i) << " ";
	}
	cout << nl;

	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;

const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

const int N = 2e5+7;
struct BIT {
	ll freq[N];
	BIT() { memset(freq, 0, sizeof freq); }
	void insert(int x, ll cnt) {
		x += 1;
		for ( ; x < N; x += x&-x)
			freq[x] += cnt;
	}
	ll query(int x) {
		x += 1;
		ll res = 0;
		for ( ; x > 0; x -= x&-x)
			res += freq[x];
		return res;
	}
	void insert(int xl, int xr, int cnt) {
		insert(xl, cnt);
		insert(xr+1, -cnt);
	}
	ll query(int xl, int xr) {
		return query(xr) - query(xl-1);
	}
};

BIT small, ans;

ll nc2(int n) {
	return (ll)n*(n-1)/2;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(10);

	int n, x;
	cin >> n >> x;

	int a[n];
	int cnt = 0;
	for (int i=0; i<n; i++) {
		cin >> a[i];
		if (a[i] < x) {
			small.insert(i, 1);
			cnt++;
		}
	}

	for (int i=1; i<=cnt; i++) {
		ans.insert(i, i, cnt-i+1);
	}

	for (int i=0; i<n; i++) {
		if (a[i] >= x) {
			int left = i; // first in segment
			while (i < n && a[i] >= x) { i++; }
			int right = i--; // past last in segment
			ans.insert(0, 0, nc2(right-left+1));

			int pass = small.query(0, left-1);
			ans.insert(1, pass, right-left);
		}
	}

	for (int i=0; i<=n; i++) {
		cout << ans.query(i) << " ";
	}
	cout << nl;

	return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef complex<ld> pt;
typedef vector<pt> pol;

const char nl = '\n';
const int INF = 0x3f3f3f3f;
const ll INFLL = 0x3f3f3f3f3f3f3f3f;
const ll MOD = 1e9+7;
const ld EPS = 1e-10;
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

typedef complex<ld> Complex;
const ld PI = acos(-1.L);

// *** Fast Fourier Transform (Iterative) ***
// Reverse-bitmasking adder. rev_incr(a,n) returns REV(REV(a)+1)
inline int rev_incr(int a, int n) { int msk = n/2, cnt=0;
  while ( a&msk ) { cnt++; a<<=1; }
  a &= msk-1; a |= msk;
  while ( cnt-- ) a >>= 1;
  return a; }
// Compute in V the discrete fourier transform of v
// dir=1: forward transform, evaluates polynomial at complex roots of unity
// dir=-1: inverse transform, interpolates point-value form to coefficients
vector<Complex> FFT(const vector<Complex>& v, int dir=1) {
  Complex wm,w,u,t; int n = v.size(); vector<Complex> V(n);
  for (int k=0,a=0; k<n; ++k, a=rev_incr(a,n))
    V[a] = v[k] / ld(dir>0 ? 1 : n);
  for (int m=2; m<=n; m<<=1) {
    wm = polar( (ld)1, dir*2*PI/m );
    for (int k=0; k<n; k+=m) {
      w = 1;
      for (int j=0; j<m/2; ++j, w*=wm) {
        u = V[k + j];
        t = w * V[k + j + m/2];
        V[k + j] = u + t;
        V[k + j + m/2] = u - t;
      } } } return V; }

const int N = 1<<18;

ll nc2(int n) {
	return (ll)n*(n-1)/2;
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cout << fixed << setprecision(10);

	int n, x;
	cin >> n >> x;

	vector<int> diff;
	int in;
	int last = -1;
	for (int i=0; i<n; i++) {
		cin >> in;
		if (in < x) {
			diff.push_back(i-last);
			last = i;
		}
	}
	diff.push_back(n-last);

	vector<ll> ans(n+1,0);
	vector<Complex> a(2*N,0), b(2*N,0);
	int k = diff.size()-1;
	for (int i=0; i<=k; i++) {
		a[i] = b[k-i] = Complex(diff[i],0);
		ans[0] += nc2(diff[i]);
	}

	a = FFT(a);
	b = FFT(b);
	for (int i=0; i<2*N; i++) {
		a[i] *= b[i];
	}
	a = FFT(a,-1);

	for (int i=1; i<=k; i++) {
		ans[i] = llround(a[k-i].real());
	}

	for (int i=0; i<=n; i++) {
		cout << ans[i] << " ";
	}
	cout << nl;

	return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ull unsigned long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 2192;

const int mod1 = 754974721;
const int w1 = 6964;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 18;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
  //  ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*b[i])%mod0;
        A[i] = (A[i]*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod1 != A[i]) a[i] += mod0;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll  long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 1847;

const int mod1 = 754974721;
const int w1 = 216;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 19;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*1ll*b[i])%mod0;
        A[i] = (A[i]*1ll*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod0 != A[i]) a[i] += mod1;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ull unsigned long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 2192;

const int mod1 = 754974721;
const int w1 = 6964;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 18;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
  //  ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*b[i])%mod0;
        A[i] = (A[i]*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod0 != A[i]) a[i] += mod1;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define int long long
#define ll  long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 1847;

const int mod1 = 754974721;
const int w1 = 216;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 19;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    ll z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*1ll*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*1ll*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*1ll*b[i])%mod0;
        A[i] = (A[i]*1ll*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        ll x = a[i];
        while(x%mod0 != A[i]) x += mod1;
        cout << x << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define int long long
#define ll  long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 1847;

const int mod1 = 754974721;
const int w1 = 216;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 19;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    int inv = tavan(N,mod-2,mod);
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*inv)%mod;
    }
}
int a[maxn];

int32_t main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    ll z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*1ll*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*1ll*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*1ll*b[i])%mod0;
        A[i] = (A[i]*1ll*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        ll x = a[i];
        while(x%mod1 != A[i]) x += mod0;
        cout << x << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int unsigned long long
#define ll long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 2192;

const int mod1 = 1811939329;
const int w1 = 512;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 18;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
  //  ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*b[i])%mod0;
        A[i] = (A[i]*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod1 != A[i]) a[i] += mod0;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ll long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 2192;

const int mod1 = 1811939329;
const int w1 = 512;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 18;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
  //  ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*b[i])%mod0;
        A[i] = (A[i]*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod1 != A[i]) a[i] += mod0;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
#define int long long
#define ull unsigned long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 1847;

const int mod1 = 754974721;
const int w1 = 216;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 19;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*tavan(N,mod-2,mod))%mod;
    }
}
int a[maxn];

int32_t main(){
  //  ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    int z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*b[i])%mod0;
        A[i] = (A[i]*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        while(a[i]%mod0 != A[i]) a[i] += mod1;
        cout << a[i] << ' ';
    }
    cout << endl;
    return 0;
}


/// In The Name Of God
///#include<bits/stdc++.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
using namespace std;

#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define int long long
#define ll  long long
#define pii pair <int , int>
#define ld long double
#define for2(a,b,c) for(int (a) = (b); (a) < (c); (a)++)
#define setp cout << fixed << setprecision(15)
#define endl "\n"
#define minit(a,b) a = min(a,b)
#define maxit(a,b) a = max(a,b)
#define PII pair<int,int>
#define Vec vector<int>
#define error(x) cerr << #x << " = " << (x) << endl;
#define all(x) (x).begin() , (x).end()

const int maxn = (1<<19)+2;;
int sum[maxn];
int A[maxn];
int b[maxn];
int B[maxn];
int n;
int N;

const int mod0 = 998244353;
const int w0 = 1847;

const int mod1 = 754974721;
const int w1 = 216;

int tavan(int x,int y,int mod){
    int res=1;while(y){if(y%2)res=(1LL*res*x)%mod;x=(1LL*x*x)%mod;y/=2;}return res;
}

const int lg = 19;

void ntt (int arr[],int rev,int mod){
    int W;
    if(mod == 0){
        W = w0;
        mod = mod0;
    }else{
        W = w1;
        mod = mod1;
    }
    for2(i,0,N){
        int j = 0;
        for2(k,0,lg) if(i&(1<<k)) j += (1<<(lg-k-1));
        if(j > i) swap(arr[i],arr[j]);
    }
    for(int len = 2; len <= N; len *= 2){
        int wn=tavan(W,(N)/len,mod);
        if(rev == -1) wn = tavan(wn,mod-2,mod);
        for(int i = 0; i < N; i += len){
            int w = 1;
            for(int j = 0; j < len/2; j ++){
                int tmp = (1ll*w*arr[i+j+len/2])%mod;
                int p1 = arr[i+j]+tmp;
                if(p1 >= mod) p1 -= mod;
                int p2 = arr[i+j]-tmp;;
                if(p2 < 0) p2 += mod;
                arr[i+j] = p1;
                arr[i+j+len/2] = p2;
                w = (w*1ll*wn)%mod;
            }
        }
    }
    int inv = tavan(N,mod-2,mod);
    if(rev == -1) for2(i,0,N){
        arr[i] = (arr[i]*1ll*inv)%mod;
    }
}
int a[maxn];

int32_t main(){
    ios::sync_with_stdio(false); cin.tie(0);
    int x; cin >> n >> x;
    int sum = 0;
    ll z = 0;
    int cnt = 0;
    a[0] ++;
    A[0] ++;
    b[n] ++;
    B[n] ++;
    for2(i,0,n){
        int y; cin >> y;
        sum += (y<x);
        a[sum] ++;
        A[sum] ++;
        b[n-sum] ++;
        B[n-sum] ++;
        if(y >= x)
            cnt++;
        else{
            z += cnt*1ll*(cnt+1)/2;
            cnt = 0;
        }
    }
    z += cnt*1ll*(cnt+1)/2;
    N = (1<<lg);
    ntt(a,1,0);
    ntt(A,1,1);
    ntt(b,1,0);
    ntt(B,1,1);
    for2(i,0,N){
        a[i] = (a[i]*1ll*b[i])%mod0;
        A[i] = (A[i]*1ll*B[i])%mod1;
    }
    ntt(a,-1,0);
    ntt(A,-1,1);
    cout << z << ' ';
    for2(i,n+1,n+n+1){
        ll x = a[i];
        while(x%mod0 != A[i]) x += mod1;
        cout << x << ' ';
    }
    cout << endl;
    return 0;
}


#include<iostream>
#include <bits/stdc++.h>
#define ll long long
#define ld  double
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using cd = complex<double>;
const double PI = acos(-1);

void fft(vector<cd> & 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)
    {
        double ang = 2 * PI / len * (invert ? -1 : 1);
        cd wlen(cos(ang), sin(ang));
        for (int i = 0; i < n; i += len)
        {
            cd w(1);
            for (int j = 0; j < len / 2; j++)
            {
                cd 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 (cd & x : a)
            x /= n;
    }
}
vector<ll> multiply(vector<int> &a, vector<int> &b)
{
    vector<cd> fa(a.begin(),a.end()), fb(b.begin(),b.end());
    int n=1;
    while(n<a.size()+b.size())
        n<<=1;
    fa.resize(n);
    fb.resize(n);

    fft(fa,0);
    fft(fb,0);

    for(int i=0; i<n; i++)
        fa[i]*=fb[i];
    fft(fa,1);
    vector<ll> res(n);
    for(int i=0; i<n; i++)
        res[i]=round(fa[i].real());
    return res;
}
int n, t, x;
vector<int> v1, v2;
int main()
{
    IO
    cin>>n>>x;
    v1.resize(n+1);
    v2.resize(n+1);
    int cnt=0;
    for(int i=1; i<=n; i++)
    {
        v1[cnt]++;
        v2[-cnt+n]++;
        int in;
        cin>>in;
        cnt+=(in<x);
    }
    v1[cnt]++;
    v2[-cnt+n]++;
    vector<ll> res=multiply(v1,v2);
    for(int i=0; i<=n; i++)
    {
        if(i==0)
            cout<<(res[i+n]-n-1)/2;
        else
            cout<<" "<<res[i+n];
    }
}


#include<iostream>
#include <bits/stdc++.h>
#define ll long long
#define ld  double
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using cd = complex<double>;
const double PI = acos(-1);

void fft(vector<cd> & 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)
    {
        double ang = 2 * PI / len * (invert ? -1 : 1);
        cd wlen(cos(ang), sin(ang));
        for (int i = 0; i < n; i += len)
        {
            cd w(1);
            for (int j = 0; j < len / 2; j++)
            {
                cd 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 (cd & x : a)
            x /= n;
    }
}
vector<int> multiply(vector<int> &a, vector<int> &b)
{
    vector<cd> fa(a.begin(),a.end()), fb(b.begin(),b.end());
    int n=1;
    while(n<a.size()+b.size())
        n<<=1;
    fa.resize(n);
    fb.resize(n);

    fft(fa,0);
    fft(fb,0);

    for(int i=0; i<n; i++)
        fa[i]*=fb[i];
    fft(fa,1);
    vector<int> res(n);
    for(int i=0; i<n; i++)
        res[i]=round(fa[i].real());
    return res;
}
int n, t, x;
vector<int> v1, v2;
int main()
{
    IO
    cin>>n>>x;
    v1.resize(n+1);
    v2.resize(n+1);
    int cnt=0;
    for(int i=1; i<=n; i++)
    {
        v1[cnt]++;
        v2[-cnt+n]++;
        int in;
        cin>>in;
        cnt+=(in<x);
    }
    v1[cnt]++;
    v2[-cnt+n]++;
    vector<int> res=multiply(v1,v2);
    for(int i=0; i<=n; i++)
    {
        if(i==0)
            cout<<(res[i+n]-n-1)/2;
        else
            cout<<" "<<res[i+n];
    }
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define s second
#define f first
#define int long long int
using cd = complex<double>;
const double PI=acos(-1);
bool che[125001][6][6];
bool vis[125001][6];
int num=0;
void fft(vector<cd> & 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){
		double ang=2*PI/len*(invert ? -1 : 1);
		cd wlen(cos(ang), sin(ang));
		for(int i=0; i<n; i+=len){
			cd w(1);
			for(int j=0; j<len/2; j++){
				cd 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(cd & x : a)
			x /= n;
	}
}

vector<int> multiply(vector<int>const& a, vector<int>const& b){
	vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
	int n=1;
	while(n<a.size()+b.size())
		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<int>result(n);
	for(int i=0; i<n; i++)
		result[i]=round(fa[i].real());
	return result;
}

main() {
	int n, x;
	cin>>n>>x;
	vector<int>v;
	for(int i=0; i<n; i++){
		int y;
		cin>>y;
		if(y<x){
			v.pb(1);
		}
		else{
			v.pb(0);
		}
	}
	vector<int>pre;
	pre.pb(0);
	for(int i=0; i<n; i++){
		pre.pb(v[i]+pre[i]);
	}
	int maxi=pre.back();
	vector<int>f;
	f.resize(maxi+1);
	for(int i=0; i<=maxi; i++){
		f[i]=0;
	}
	for(int i=0; i<pre.size(); i++){
		f[pre[i]]++;
	}
	vector<int>fr;
	for(int i=0; i<f.size(); i++){
		fr.pb(f[i]);
	}

	reverse(fr.begin(), fr.end());
	vector<int>mul=multiply(f, fr);
	vector<pair<int, int>>r;

	for(int i=0; i<n; i++){
		if(r.size()==0){
			if(v[i]==0){
				r.pb({1, 0});
			}
			else{
				r.pb({1, 1});
			}
			continue;
		}
		int val=r.back().s;
		int cnt=r.back().f;
		if(v[i]==val){
			r.pop_back();
			r.pb({cnt+1, val});
		}
		else{
			r.pb({1, 1-val});
		}
	}
	int ans=0;

	for(auto u:r){
		if(u.s==0){
			ans+=((u.f)*(u.f+1))/2;
		}
	}
	cout<<ans<<" ";
	for(int i=1; i<=n; i++){
		cout<<mul[maxi+i]<<" ";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define s second
#define f first
#define int long long int
using cd = complex<double>;
const double PI=acos(-1);
bool che[125001][6][6];
bool vis[125001][6];
int num=0;
void fft(vector<cd> & 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){
		double ang=2*PI/len*(invert ? -1 : 1);
		cd wlen(cos(ang), sin(ang));
		for(int i=0; i<n; i+=len){
			cd w(1);
			for(int j=0; j<len/2; j++){
				cd 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(cd & x : a)
			x /= n;
	}
}

vector<int> multiply(vector<int>const& a, vector<int>const& b){
	vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
	int n=1;
	while(n<a.size()+b.size())
		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<int>result(n);
	for(int i=0; i<n; i++)
		result[i]=round(fa[i].real());
	return result;
}

main() {
	int n, x;
	cin>>n>>x;
	vector<int>v;
	for(int i=0; i<n; i++){
		int y;
		cin>>y;
		if(y<x){
			v.pb(1);
		}
		else{
			v.pb(0);
		}
	}
	vector<int>pre;
	pre.pb(0);
	for(int i=0; i<n; i++){
		pre.pb(v[i]+pre[i]);
	}
	int maxi=pre.back();
	vector<int>f;
	f.resize(maxi+1);
	for(int i=0; i<=maxi; i++){
		f[i]=0;
	}
	for(int i=0; i<pre.size(); i++){
		f[pre[i]]++;
	}
	vector<int>fr;
	for(int i=0; i<f.size(); i++){
		fr.pb(f[i]);
	}

	reverse(fr.begin(), fr.end());
	vector<int>mul=multiply(f, fr);
	vector<pair<int, int>>r;

	for(int i=0; i<n; i++){
		if(r.size()==0){
			if(v[i]==0){
				r.pb({1, 0});
			}
			else{
				r.pb({1, 1});
			}
		}
		int val=r.back().s;
		int cnt=r.back().f;
		if(v[i]==val){
			r.pop_back();
			r.pb({cnt+1, val});
		}
		else{
			r.pb({1, 1-val});
		}
	}
	int ans=0;
	for(auto u:r){
		if(u.s==0){
			ans+=((u.f)*(u.f+1))/2;
		}
	}
	cout<<ans<<" ";
	for(int i=1; i<=n; i++){
		cout<<mul[maxi+i]<<" ";
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define s second
#define f first
#define int long long int
using cd = complex<double>;
const double PI=acos(-1);
bool che[125001][6][6];
bool vis[125001][6];
int num=0;
void fft(vector<cd> & 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){
		double ang=2*PI/len*(invert ? -1 : 1);
		cd wlen(cos(ang), sin(ang));
		for(int i=0; i<n; i+=len){
			cd w(1);
			for(int j=0; j<len/2; j++){
				cd 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(cd & x : a)
			x /= n;
	}
}

vector<int> multiply(vector<int>const& a, vector<int>const& b){
	vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
	int n=1;
	while(n<a.size()+b.size())
		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<int>result(n);
	for(int i=0; i<n; i++)
		result[i]=round(fa[i].real());
	return result;
}

main() {
	int n, x;
	cin>>n>>x;
	vector<int>v;
	for(int i=0; i<n; i++){
		int y;
		cin>>y;
		if(y<x){
			v.pb(1);
		}
		else{
			v.pb(0);
		}
	}
	vector<int>pre;
	pre.pb(0);
	for(int i=0; i<n; i++){
		pre.pb(v[i]+pre[i]);
	}
	int maxi=pre.back();
	vector<int>f;
	f.resize(maxi+1);
	for(int i=0; i<=maxi; i++){
		f[i]=0;
	}
	for(int i=0; i<pre.size(); i++){
		f[pre[i]]++;
	}
	vector<int>fr;
	for(int i=0; i<f.size(); i++){
		fr.pb(f[i]);
	}

	reverse(fr.begin(), fr.end());
	vector<int>mul=multiply(f, fr);
	vector<pair<int, int>>r;

	for(int i=0; i<n; i++){
		if(r.size()==0){
			if(v[i]==0){
				r.pb({1, 0});
			}
			else{
				r.pb({1, 1});
			}
			continue;
		}
		int val=r.back().s;
		int cnt=r.back().f;
		if(v[i]==val){
			r.pop_back();
			r.pb({cnt+1, val});
		}
		else{
			r.pb({1, 1-val});
		}
	}
	int ans=0;

	for(auto u:r){
		if(u.s==0){
			ans+=((u.f)*(u.f+1))/2;
		}
	}
	for(int i=0; i<=n; i++){
		mul.pb(0);
	}
	cout<<ans<<" ";
	for(int i=1; i<=n; i++){
		cout<<mul[maxi+i]<<" ";
	}

	return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define s second
#define f first
#define int long long int
using cd = complex<double>;
const double PI=acos(-1);
bool che[125001][6][6];
bool vis[125001][6];
int num=0;
void fft(vector<cd> & 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){
		double ang=2*PI/len*(invert ? -1 : 1);
		cd wlen(cos(ang), sin(ang));
		for(int i=0; i<n; i+=len){
			cd w(1);
			for(int j=0; j<len/2; j++){
				cd 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(cd & x : a)
			x /= n;
	}
}

vector<int> multiply(vector<int>const& a, vector<int>const& b){
	vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
	int n=1;
	while(n<a.size()+b.size())
		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<int>result(n);
	for(int i=0; i<n; i++)
		result[i]=round(fa[i].real());
	return result;
}

main() {
	int n, x;
	cin>>n>>x;
	vector<int>v;
	for(int i=0; i<n; i++){
		int y;
		cin>>y;
		if(y<x){
			v.pb(1);
		}
		else{
			v.pb(0);
		}
	}
	vector<int>pre;
	pre.pb(0);
	for(int i=0; i<n; i++){
		pre.pb(v[i]+pre[i]);
	}
	int maxi=pre.back();
	vector<int>f;
	f.resize(maxi+1);
	for(int i=0; i<=maxi; i++){
		f[i]=0;
	}
	for(int i=0; i<pre.size(); i++){
		f[pre[i]]++;
	}
	vector<int>fr;
	for(int i=0; i<f.size(); i++){
		fr.pb(f[i]);
	}

	reverse(fr.begin(), fr.end());
	vector<int>mul=multiply(f, fr);
	vector<pair<int, int>>r;

	for(int i=0; i<n; i++){
		if(r.size()==0){
			if(v[i]==0){
				r.pb({1, 0});
			}
			else{
				r.pb({1, 1});
			}
			continue;
		}
		int val=r.back().s;
		int cnt=r.back().f;
		if(v[i]==val){
			r.pop_back();
			r.pb({cnt+1, val});
		}
		else{
			r.pb({1, 1-val});
		}
	}
	int ans=0;

	for(auto u:r){
		if(u.s==0){
			ans+=((u.f)*(u.f+1))/2;
		}
	}
	int num=mul.size();
	cout<<ans<<" ";
	for(int i=1; i<=num-2; i++){
		cout<<mul[maxi+i]<<" ";
	}
	for(int i=num-1; i<=n; i++){
		cout<<0<<" ";
	}
	return 0;
}