#include<cmath>
#include<cstdio>
#include<iostream>
#define maxn 500000
#define ll long long
using namespace std;
const double Pi=acos(-1.0);
struct complex{
	double x,y;
	complex (double xx=0,double yy=0){x=xx,y=yy;}
}a[maxn],b[maxn],c[maxn];
int n,m,sum[200001],o[200001],k,lim,r[maxn],l;
ll ans;
complex operator + (complex a,complex b){return complex(a.x+b.x,a.y+b.y);}
complex operator - (complex a,complex b){return complex(a.x-b.x,a.y-b.y);}
complex operator * (complex a,complex b){return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
void FFT(complex *a,int inv){
	for (int i=0; i<lim; i++)
		if (i<r[i]) swap(a[i],a[r[i]]);
	for (int i=1; i<lim; i<<=1){
		complex wn(cos(Pi/i),inv*sin(Pi/i));
		for (int j=0; j<lim; j+=(i<<1)){
			complex w(1,0);
			for (int k=0; k<i; k++,w=w*wn){
				complex x=a[j+k],y=w*a[j+i+k];
				a[j+k]=x+y; a[j+i+k]=x-y;
			}
		}
	}
}
int main(){
	int x;
	scanf("%d%d",&n,&m); o[0]=1;
	for (int i=1; i<=n; i++){
		scanf("%d",&x),x=(x<m);
		sum[i]=sum[i-1]+x; o[sum[i]]++;
	}
	for (int i=0; i<=n; i++) a[i].x=o[i],b[i].x=o[n-i];
	lim=1; while (lim<=2*n+2) lim<<=1,l++;
	for (int i=0; i<lim; i++)
		r[i]=(r[i>>1]>>1)|((i&1)<<(l-1));
	FFT(a,1); FFT(b,1);
	for (int i=0; i<=lim; i++) c[i]=a[i]*b[i];
	FFT(c,-1);
	for (int i=0; i<=n; i++) ans+=o[i]*(o[i]-1)/2;
	printf("%lld ",ans);
	for (int i=n-1; i>=0; i--)
		printf("%lld ",(ll)(c[i].x/lim+0.5));
	return 0;
}


#include<bits/stdc++.h>
using std::min;
using std::max;
using std::swap;
using std::vector;
typedef double db;
typedef long long ll;
#define pb(A) push_back(A)
#define pii std::pair<int,int>
#define all(A) A.begin(),A.end()
#define mp(A,B) std::make_pair(A,B)
const int N=2e5+5;
const db Pi=acos(-1);

int n,m,lim,rev[N],a[N],f[N],ans[N];

struct cp{
    db x,y;
    cp(db a=0,db b=0){x=a,y=b;}
    friend cp operator+(cp a,cp b){return cp(a.x+b.x,a.y+b.y);}
    friend cp operator-(cp a,cp b){return cp(a.x-b.x,a.y-b.y);}
    friend cp operator*(cp a,cp b){return cp(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
}x[N],y[N];

int getint(){
    int X=0,w=0;char ch=getchar();
    while(!isdigit(ch))w|=ch=='-',ch=getchar();
    while( isdigit(ch))X=X*10+ch-48,ch=getchar();
    if(w) return -X;return X;
}

void fft(cp *f,int opt){
    for(int i=1;i<lim;i++) if(i<rev[i]) swap(f[i],f[rev[i]]);
    for(int mid=1;mid<lim;mid<<=1){
        cp tmp=cp(cos(Pi/mid),sin(Pi/mid)*opt);
        for(int R=mid<<1,l=0;l<lim;l+=R){
            cp w=cp(1,0);
            for(int k=0;k<mid;k++,w=w*tmp){
                cp x=f[l+k],y=w*f[l+k+mid];
                f[l+k]=x+y;f[l+k+mid]=x-y;
            }
        }
    }
}

signed main(){
    n=getint(),m=getint();
    for(int i=1;i<=n;i++) a[i]=getint(),f[i]=f[i-1]+(a[i]<m);
    for(int i=0;i<=n;i++) x[f[i]].x++,y[n-f[i]].x++;
    lim=1;while(lim<=4*n) lim<<=1;
    for(int i=1;i<lim;i++) rev[i]=(rev[i>>1]>>1)|(i&1?lim>>1:0);
    fft(x,1),fft(y,1);
    for(int i=0;i<lim;i++) x[i]=x[i]*y[i];
    fft(x,-1);ll now=0,las=0;
    for(int i=1;i<=n;i++){
        if(f[i]==f[las]) now+=i-las;
        else las=i;
    } printf("%lld ",now);
    for(int i=n+1;i<=2*n;i++) printf("%lld ",(ll)(x[i].x/lim+0.5));
    return 0;
}


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || a[i]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        cout << ans[i] % mod + mod) % mod << endl;
}


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || inp[i] - inp[i - 1]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

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


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || !a[i]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        cout << (ans[i] % mod + mod) % mod << ' ';
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 4 * 2e5 + 10;
typedef complex<double> c;

int n, inp[N], x, cnt;

ll ans[N];

c a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void fft(c *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        c wn = c(cos(2 * acos(-1) * ty / i), sin(2 * acos(-1) * ty / i));
        for(int j = 0 ; j < n ; j += i) {
            c w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                c u = f[k], v = w * f[k + i / 2];
                f[k] = u + v;
                f[k + i / 2] = u - v;
                w = w * wn;
            }
        }
    }

    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty == -1) {
            a[i] /= n;
        }
    }
}

int A[N], B[N];

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ A[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ B[inp[n] - inp[i]];
    for(int i = 0 ; i <= n ; ++ i) a[i] = A[i], b[i] = B[i];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    fft(a, len, 1), fft(b, len, 1);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i];
    fft(a, len, -1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = (ll) (a[i].real() + 0.5);
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || inp[i] - inp[i - 1]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

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


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || inp[i] - inp[i - 1]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        if(i == 0) cout << ans[i] << ' ';
        else cout << (ans[i] % mod + mod) % mod << ' ';
}


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || a[i]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        cout << (ans[i] % mod + mod) % mod << endl;
}


#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 4 * 2e5 + 10;
typedef complex<double> c;

int n, inp[N], x, cnt;

ll ans[N];

c a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void fft(c *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        c wn = c(cos(2 * acos(-1) * ty / i), sin(2 * acos(-1) * ty / i));
        for(int j = 0 ; j < n ; j += i) {
            c w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                c u = f[k], v = w * f[k + i / 2];
                f[k] = u + v;
                f[k + i / 2] = u - v;
                w = w * wn;
            }
        }
    }

    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty == -1) {
            a[i] /= n;
        }
    }
}

int A[N], B[N];

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ A[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ B[inp[n] - inp[i]];
    for(int i = 0 ; i <= n ; ++ i) a[i] = A[i], b[i] = B[i];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    fft(a, len, 1), fft(b, len, 1);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i];
    fft(a, len, -1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = int(a[i].real() + 0.5);
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || inp[i] - inp[i - 1]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

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


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || a[i]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        cout << (ans[i] % mod + mod) % mod << ' ';
}


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

const int N = 4 * 2e5 + 10, mod = 998244353;
ll pw(ll a, ll b) {
    ll r = 1;
    for( ; b ; b >>= 1, a = a * a % mod)
        if(b & 1)
            r = r * a % mod;
    return r;
}
const ll g[2] = { 3, pw(3, mod - 2) };
//const ll g[2] = { 3, (mod + 1) / 3 };

int n, inp[N], x, cnt;

ll ans[N], a[N], b[N], f[N];

int rev(int x, int n) {
    int r = 0;
    for(int i = 0 ; (1 << i) < n ; ++ i)
        r = (r << 1) | ((x >> i) & 1);
    return r;
}

void ntt(ll *a, int n, int ty) {
    for(int i = 0 ; i < n ; ++ i) f[rev(i, n)] = a[i];

    for(int i = 2 ; i <= n ; i <<= 1) {
        ll wn = pw(g[ty], (mod - 1) / i);
        for(int j = 0 ; j < n ; j += i) {
            ll w = 1;
            for(int k = j ; k < j + i / 2 ; ++ k) {
                ll u = f[k], v = w * f[k + i / 2] % mod;
                f[k] = (u + v) % mod;
                f[k + i / 2] = (u - v) % mod;
                w = w * wn % mod;
            }
        }
    }

    ll inv = pw(n, mod - 2);
    for(int i = 0 ; i < n ; ++ i) {
        a[i] = f[i];
        if(ty) {
            a[i] = a[i] * inv % mod;
        }
    }
}

int main() {
    ios :: sync_with_stdio();
    cin >> n >> x;
    for(int i = 1 ; i <= n ; ++ i) cin >> inp[i], inp[i] = inp[i] < x, inp[i] += inp[i - 1];

    for(int i = 1 ; i <= n ; ++ i) ++ a[inp[i - 1]];
    for(int i = 1 ; i <= n ; ++ i) ++ b[inp[n] - inp[i]];
    int len = 1; while(len <= 2 * n + 10) len <<= 1;

    ntt(a, len, 0), ntt(b, len, 0);
    for(int i = 0 ; i < len ; ++ i) a[i] = a[i] * b[i] % mod;
    ntt(a, len, 1);

    for(int i = 0 ; i < inp[n] ; ++ i) {
        ans[inp[n] - i] = a[i];
    }

    for(int i = 1, len = 0 ; i <= n + 1 ; ++ i) {
        if(i == n + 1 || inp[i] - inp[i - 1]) ans[0] += (ll) len * (len + 1) / 2, len = 0;
        else ++ len;
    }

    for(int i = 0 ; i <= n ; ++ i)
        cout << (ans[i] % mod + mod) % mod << ' ';
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const int N=1e6+100;
const int g=3;
const LL mod=998244353;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)T=Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
int main(){
//	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<=Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[2*tot-i-1];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const int N=1e6+100;
const int g=3;
const LL mod=2281701377;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)T=Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
int main(){
//	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<=Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[2*tot-i-1];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
#define int long long
const int N=1e6+100;
const int g=31;
const LL mod=2013265921;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)T=Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
signed main(){
//	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<=Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[2*tot-i-1];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const int N=5e5+100;
const int g=3;
const LL mod=998244353;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)T=Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
int main(){
//	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<=Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[2*tot-i-1];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const double Pi=acos(-1.0);
const int N=1e6+100;
struct CP{
	double x,y;
	CP(double _x=0.0,double _y=0.0):x(_x),y(_y){}
	friend CP operator + (CP A,CP B){return CP(A.x+B.x,A.y+B.y);}
	friend CP operator - (CP A,CP B){return CP(A.x-B.x,A.y-B.y);}
	friend CP operator * (CP A,CP B){return CP(A.x*B.x-A.y*B.y,A.x*B.y+B.x*A.y);}
}F[N],G[N];
int R[N];
int Lim=1;
int m;
int L=0;
void DFT(CP *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=(i<<1)){
		CP T=CP(cos(Pi/i),flag*sin(Pi/i));
		for(int j=0;j<Lim;j+=(i<<1)){
			CP t=CP(1,0);
			for(int l=0;l<i;++l,t=t*T){
				CP Nx=A[j+l];
				CP Ny=t*A[i+j+l];
				A[j+l]=Nx+Ny;
				A[i+j+l]=Nx-Ny;
			}
		}
	}
}
int n,x;
int A[N];
LL ans[N]={};
int sum[N]={};
int main(){
// 	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last].x++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last].x++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	DFT(F,1);
	DFT(G,1);
	for(int i=0;i<Lim;++i)F[i]=F[i]*G[i];
	DFT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=(LL)(F[2*tot-i-1].x/Lim+0.5);
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const int N=1e6+100;
const int g=31;
const LL mod=2013265921;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)T=Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
int main(){
//	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	++tot;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<=Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[2*tot-i-1];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
//F 前缀和为k
//G 后缀和为k
typedef long long LL;
const int N=5e5+100;
const int g=3;
const LL mod=998244353;
int Lim=1;
int L=0;
LL Quick_Pow(LL x,int k){
	LL ret=1;
	while(k){
		if(k&1)ret=ret*x%mod;
		x=x*x%mod;
		k/=2;
	}
	return ret;
}
LL F[N];
LL G[N];
int R[N];
void NTT(LL *A,int flag){
	for(int i=0;i<Lim;++i)if(i<R[i])swap(A[i],A[R[i]]);
	for(int i=1;i<Lim;i=i<<1){
		LL T=Quick_Pow(g,(mod-1)/(i*2));
		if(flag==-1)Quick_Pow(T,mod-2);
		for(int j=0;j<Lim;j+=(i<<1)){
			LL t=1;
			for(int l=0;l<i;++l,t=t*T%mod){
				LL Nx=A[j+l];
				LL Ny=t*A[i+j+l];
				A[j+l]=(Nx+Ny)%mod;
				A[i+j+l]=((Nx-Ny)%mod+mod)%mod;
			}
		}
	}
	if(flag==1)return;
	LL inv=Quick_Pow(Lim,mod-2);
	for(int i=0;i<Lim;++i)A[i]=A[i]*inv%mod;
}
int n,x;
int A[N];
int ans[N]={};
int sum[N]={};
int main(){
// 	freopen("CF963E.in","r",stdin);
	scanf("%d%d",&n,&x);
	for(int i=1;i<=n;++i)scanf("%d",&A[i]);
	int last=0;
	for(int i=1;i<=n;++i){
		last=last+(A[i]<x);
		F[last]++;
	}
	int tot=last;
	last=0;
	for(int i=n;i>=1;--i){
		last=last+(A[i]<x);
		G[last]++;
	}
	for(;Lim<tot*2;Lim=Lim<<1,++L);
	for(int i=0;i<Lim;++i)R[i]=(R[i>>1]>>1)|((i&1)<<(L-1));
	NTT(F,1);
	NTT(G,1);
	for(int i=0;i<Lim;++i)F[i]=F[i]*G[i]%mod;
	NTT(F,-1);
	for(int i=0;i<tot;++i)ans[tot-i]=F[i];
   	int now=0;
   	for(int i=1;i<=n;++i){
   		sum[i]=sum[i-1]+(A[i]<x);
   	}
    for(int i=1;i<=n;++i)
        if(sum[i]==sum[i-1]) ++now;
        else ans[0]+=1LL*now*(now-1)/2+now,now=0;
    ans[0]+=1LL*now*(now-1)/2+now;
	for(int i=0;i<=n+1;++i){
		cout<<ans[i]<<" ";
	}
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cmath>
#include <complex>

using namespace std;

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

#ifdef WIN32
#define LLIO "%I64d"
#else
#define LLIO "%lld"
#endif

struct FastIO {
    inline FastIO& operator >> (int& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (long long& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (double& x) {
        x = 0; char f = 0, ch = getchar();
        double d = 0.1;
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        if(ch == '.') {
            ch = getchar();
            while(ch <= '9' && ch >= '0') x += d * (ch ^ 48), d *= 0.1, ch = getchar();
        }
        return x = (f ? -x : x), *this;
    }
}rin;
const ll N = 1e6 + 60;
const double pi = acos(-1.0);
int limit = 1, l = 0;
int f[200050], rev[N];
complex <double> cnt[N], k[N];
void ntt(complex <double> *p, int flag) {
	for(int i = 0 ; i < limit ; ++ i) if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int i = 1 ; i < limit ; i <<= 1) {
		int block = i << 1;
		complex <double> wn {cos(pi / i), sin(pi / i) * flag};
		for(int j = 0 ; j < limit ; j += block) {
			complex <double> w {1, 0};
			for(int k = j ; k < j + i ; ++ k) {
				complex <double> x = p[k], y = p[k + i] * w;
				p[k] = x + y;
				p[k + i] = x - y;
				w = w * wn;
			}
		}
	}
	if(flag == -1) {
		for(int i = 0 ; i < limit ; ++ i) p[i].real(p[i].real() / limit);
	}
}
int main() {
	int n, kk; rin >> n >> kk;
	for(int i = 1 ; i <= n ; ++ i) {
		int x; rin >> x;
		f[i] = x < kk;
	}
	cnt[0] = 1;
	for(int i = 1 ; i <= n ; ++ i) f[i] = f[i] + f[i - 1], cnt[f[i]].real(cnt[f[i]].real() + 1);

	for(int i = 0 ; i <= f[n] ; ++ i) k[i] = cnt[f[n] - i];
	while(limit <= (f[n] << 1)) limit <<= 1, ++ l;
	for(int i = 0 ; i < limit ; ++ i) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", cnt[i]); puts("");
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", k[i]); puts("");

	ntt(cnt, 1), ntt(k, 1);
	for(int i = 0 ; i < limit ; ++ i) cnt[i] = cnt[i] * k[i];
	ntt(cnt, -1);

	ll ans = 0;
	int cntt = 1;
	f[0] = 0;
	f[n + 1] = -1;
	for(int i = 1 ; i <= n + 1 ; ++ i) {
		if(f[i] != f[i - 1]) {
			ans += 1ll * (cntt - 1) * (cntt) / 2;
			cntt = 1;
		}
		else ++ cntt;
	}
	printf(LLIO" ", ans);
	for(int i = f[n] + 1 ; i < f[n] + n + 1 ; ++ i) printf("%.0f ", fabs(round(cnt[i].real())));
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cmath>

using namespace std;

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

#ifdef WIN32
#define LLIO "%I64d"
#else
#define LLIO "%lld"
#endif

struct FastIO {
    inline FastIO& operator >> (int& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (long long& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (double& x) {
        x = 0; char f = 0, ch = getchar();
        double d = 0.1;
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        if(ch == '.') {
            ch = getchar();
            while(ch <= '9' && ch >= '0') x += d * (ch ^ 48), d *= 0.1, ch = getchar();
        }
        return x = (f ? -x : x), *this;
    }
}rin;
const int N = 1e6 + 60, mod = 998244353, g = 3, gi = 332748118;
int limit = 1, l = 0;
int f[200050], rev[N];
ll cnt[N], k[N];
ll ksm(ll a, ll p) {
	ll ans = 1;
	while(p) {
		if(p & 1) ans = ans * a % mod;
		a = a * a % mod;
		p >>= 1;
	}
	return ans;
}
void ntt(ll *p, int flag) {
	for(int i = 0 ; i < limit ; ++ i) if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int i = 1 ; i < limit ; i <<= 1) {
		int block = i << 1;
		ll wn = ksm(flag == 1 ? g : gi, (mod - 1) / block);
		for(int j = 0 ; j < limit ; j += block) {
			ll w = 1;
			for(int k = j ; k < j + i ; ++ k) {
				ll x = p[k], y = p[k + i] * w % mod;
				p[k] = x + y;
				p[k + i] = x - y + mod;
				if(p[k] > mod) p[k] -= mod;
				if(p[k + i] > mod) p[k + i] -= mod;
				w = w * wn % mod;
			}
		}
	}
	if(flag == -1) {
		ll inv = ksm(limit, mod - 2);
		for(int i = 0 ; i < limit ; ++ i) p[i] = p[i] * inv % mod;
	}
}
int main() {
	int n, kk; rin >> n >> kk;
	for(int i = 1 ; i <= n ; ++ i) {
		int x; rin >> x;
		f[i] = x < kk;
	}
	for(int i = 1 ; i <= n ; ++ i) f[i] = f[i] + f[i - 1], ++ cnt[f[i]];
	cnt[0] = 1;
	for(int i = 0 ; i <= f[n] ; ++ i) k[i] = cnt[f[n] - i];
	while(limit <= (f[n] << 1)) limit <<= 1, ++ l;
	for(int i = 0 ; i < limit ; ++ i) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", cnt[i]); puts("");
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", k[i]); puts("");

	ntt(cnt, 1), ntt(k, 1);
	for(int i = 0 ; i < limit ; ++ i) cnt[i] = cnt[i] * k[i] % mod;
	ntt(cnt, -1);

	ll ans = 0;
	int cntt = 1;
	f[0] = -1;
	f[n + 1] = -1;
	for(int i = 1 ; i <= n + 1 ; ++ i) {
//		printf("%d ", f[i]);
		if(f[i] != f[i - 1]) {
			ans += (cntt - 1) * (cntt) / 2;
			cntt = 1;
		}
		else ++ cntt;
	}
//	puts("");
	printf(LLIO" ", ans);
	for(int i = f[n] + 1 ; i < f[n] + n + 1 ; ++ i) printf(LLIO" ", cnt[i]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cmath>

using namespace std;

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

#ifdef WIN32
#define LLIO "%I64d"
#else
#define LLIO "%lld"
#endif

struct FastIO {
    inline FastIO& operator >> (int& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (long long& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (double& x) {
        x = 0; char f = 0, ch = getchar();
        double d = 0.1;
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        if(ch == '.') {
            ch = getchar();
            while(ch <= '9' && ch >= '0') x += d * (ch ^ 48), d *= 0.1, ch = getchar();
        }
        return x = (f ? -x : x), *this;
    }
}rin;
const int N = 1e6 + 60, mod = 998244353, g = 3, gi = 332748118;
int limit = 1, l = 0;
int f[200050], rev[N];
ll cnt[N], k[N];
ll ksm(ll a, ll p) {
	ll ans = 1;
	while(p) {
		if(p & 1) ans = ans * a % mod;
		a = a * a % mod;
		p >>= 1;
	}
	return ans;
}
void ntt(ll *p, int flag) {
	for(int i = 0 ; i < limit ; ++ i) if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int i = 1 ; i < limit ; i <<= 1) {
		int block = i << 1;
		ll wn = ksm(flag == 1 ? g : gi, (mod - 1) / block);
		for(int j = 0 ; j < limit ; j += block) {
			ll w = 1;
			for(int k = j ; k < j + i ; ++ k) {
				ll x = p[k], y = p[k + i] * w % mod;
				p[k] = x + y;
				p[k + i] = x - y + mod;
				if(p[k] > mod) p[k] -= mod;
				if(p[k + i] > mod) p[k + i] -= mod;
				w = w * wn % mod;
			}
		}
	}
	if(flag == -1) {
		ll inv = ksm(limit, mod - 2);
		for(int i = 0 ; i < limit ; ++ i) p[i] = p[i] * inv % mod;
	}
}
int main() {
	int n, kk; rin >> n >> kk;
	for(int i = 1 ; i <= n ; ++ i) {
		int x; rin >> x;
		f[i] = x < kk;
	}
	for(int i = 1 ; i <= n ; ++ i) f[i] = f[i] + f[i - 1], ++ cnt[f[i]];
	cnt[0] = 1;
	for(int i = 0 ; i <= f[n] ; ++ i) k[i] = cnt[f[n] - i];
	while(limit <= (f[n] << 1)) limit <<= 1, ++ l;
	for(int i = 0 ; i < limit ; ++ i) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", cnt[i]); puts("");
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", k[i]); puts("");

	ntt(cnt, 1), ntt(k, 1);
	for(int i = 0 ; i < limit ; ++ i) cnt[i] = cnt[i] * k[i] % mod;
	ntt(cnt, -1);

	ll ans = 0;
	int cntt = 1;
	f[0] = 0;
	f[n + 1] = -1;
	for(int i = 1 ; i <= n + 1 ; ++ i) {
//		printf("%d ", f[i]);
//		printf("%d ", cntt);
		if(f[i] != f[i - 1]) {
			ans += 1ll * (cntt - 1) * (cntt) / 2;
			cntt = 1;
		}
		else ++ cntt;
	}
//	puts("");
	printf(LLIO" ", ans);
	for(int i = f[n] + 1 ; i < f[n] + n + 1 ; ++ i) printf(LLIO" ", cnt[i]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cmath>

using namespace std;

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

#ifdef WIN32
#define LLIO "%I64d"
#else
#define LLIO "%lld"
#endif

struct FastIO {
    inline FastIO& operator >> (int& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (long long& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (double& x) {
        x = 0; char f = 0, ch = getchar();
        double d = 0.1;
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        if(ch == '.') {
            ch = getchar();
            while(ch <= '9' && ch >= '0') x += d * (ch ^ 48), d *= 0.1, ch = getchar();
        }
        return x = (f ? -x : x), *this;
    }
}rin;
const int N = 1e6 + 60, mod = 998244353, g = 3, gi = 332748118;
int limit = 1, l = 0;
int f[200050], rev[N];
ll cnt[N], k[N];
ll ksm(ll a, ll p) {
	ll ans = 1;
	while(p) {
		if(p & 1) ans = ans * a % mod;
		a = a * a % mod;
		p >>= 1;
	}
	return ans;
}
void ntt(ll *p, int flag) {
	for(int i = 0 ; i < limit ; ++ i) if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int i = 1 ; i < limit ; i <<= 1) {
		int block = i << 1;
		ll wn = ksm(flag == 1 ? g : gi, (mod - 1) / block);
		for(int j = 0 ; j < limit ; j += block) {
			ll w = 1;
			for(int k = j ; k < j + i ; ++ k) {
				ll x = p[k], y = p[k + i] * w % mod;
				p[k] = x + y;
				p[k + i] = x - y + mod;
				if(p[k] > mod) p[k] -= mod;
				if(p[k + i] > mod) p[k + i] -= mod;
				w = w * wn % mod;
			}
		}
	}
	if(flag == -1) {
		ll inv = ksm(limit, mod - 2);
		for(int i = 0 ; i < limit ; ++ i) p[i] = p[i] * inv % mod;
	}
}
int main() {
	int n, kk; rin >> n >> kk;
	for(int i = 1 ; i <= n ; ++ i) {
		int x; rin >> x;
		f[i] = x < kk;
	}
	cnt[0] = 1;
	for(int i = 1 ; i <= n ; ++ i) f[i] = f[i] + f[i - 1], ++ cnt[f[i]];

	for(int i = 0 ; i <= f[n] ; ++ i) k[i] = cnt[f[n] - i];
	while(limit <= (f[n] << 1)) limit <<= 1, ++ l;
	for(int i = 0 ; i < limit ; ++ i) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", cnt[i]); puts("");
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", k[i]); puts("");

	ntt(cnt, 1), ntt(k, 1);
	for(int i = 0 ; i < limit ; ++ i) cnt[i] = cnt[i] * k[i] % mod;
	ntt(cnt, -1);

	ll ans = 0;
	int cntt = 1;
	f[0] = 0;
	f[n + 1] = -1;
	for(int i = 1 ; i <= n + 1 ; ++ i) {
		if(f[i] != f[i - 1]) {
			ans += 1ll * (cntt - 1) * (cntt) / 2;
			cntt = 1;
		}
		else ++ cntt;
	}
	printf(LLIO" ", ans);
	for(int i = f[n] + 1 ; i < f[n] + n + 1 ; ++ i) printf(LLIO" ", cnt[i]);
//	for(int i = 0 ; i < limit ; ++ i) printf(LLIO" ", cnt[i]);
	return 0;
}


#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <bitset>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <cmath>

using namespace std;

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

#ifdef WIN32
#define LLIO "%I64d"
#else
#define LLIO "%lld"
#endif

struct FastIO {
    inline FastIO& operator >> (int& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (long long& x) {
        x = 0; char f = 0, ch = getchar();
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        return x = (f ? -x : x), *this;
    }
    inline FastIO& operator >> (double& x) {
        x = 0; char f = 0, ch = getchar();
        double d = 0.1;
        while(ch > '9' || ch < '0') f |= (ch == '-'), ch = getchar();
        while(ch <= '9' && ch >= '0') x = x * 10 + ch - 48, ch = getchar();
        if(ch == '.') {
            ch = getchar();
            while(ch <= '9' && ch >= '0') x += d * (ch ^ 48), d *= 0.1, ch = getchar();
        }
        return x = (f ? -x : x), *this;
    }
}rin;
const int N = 1e6 + 60, mod = 998244353, g = 3, gi = 332748118;
int limit = 1, l = 0;
int f[200050], rev[N];
ll cnt[N], k[N];
ll ksm(ll a, ll p) {
	ll ans = 1;
	while(p) {
		if(p & 1) ans = ans * a % mod;
		a = a * a % mod;
		p >>= 1;
	}
	return ans;
}
void ntt(ll *p, int flag) {
	for(int i = 0 ; i < limit ; ++ i) if(i < rev[i]) swap(p[i], p[rev[i]]);
	for(int i = 1 ; i < limit ; i <<= 1) {
		int block = i << 1;
		ll wn = ksm(flag == 1 ? g : gi, (mod - 1) / block);
		for(int j = 0 ; j < limit ; j += block) {
			ll w = 1;
			for(int k = j ; k < j + i ; ++ k) {
				ll x = p[k], y = p[k + i] * w % mod;
				p[k] = x + y;
				p[k + i] = x - y + mod;
				if(p[k] > mod) p[k] -= mod;
				if(p[k + i] > mod) p[k + i] -= mod;
				w = w * wn % mod;
			}
		}
	}
	if(flag == -1) {
		ll inv = ksm(limit, mod - 2);
		for(int i = 0 ; i < limit ; ++ i) p[i] = p[i] * inv % mod;
	}
}
int main() {
	int n, kk; rin >> n >> kk;
	for(int i = 1 ; i <= n ; ++ i) {
		int x; rin >> x;
		f[i] = x < kk;
	}
	for(int i = 1 ; i <= n ; ++ i) f[i] = f[i] + f[i - 1], ++ cnt[f[i]];
	cnt[0] = 1;
	for(int i = 0 ; i <= f[n] ; ++ i) k[i] = cnt[f[n] - i];
	while(limit <= (f[n] << 1)) limit <<= 1, ++ l;
	for(int i = 0 ; i < limit ; ++ i) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (l - 1));
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", cnt[i]); puts("");
//	for(int i = 0 ; i <= f[n] ; ++ i) printf("%d ", k[i]); puts("");

	ntt(cnt, 1), ntt(k, 1);
	for(int i = 0 ; i < limit ; ++ i) cnt[i] = cnt[i] * k[i] % mod;
	ntt(cnt, -1);

	ll ans = 0;
	int cntt = 1;
	f[0] = -1;
	f[n + 1] = -1;
	for(int i = 1 ; i <= n + 1 ; ++ i) {
//		printf("%d ", f[i]);
		if(f[i] != f[i - 1]) {
			ans += 1ll * (cntt - 1) * (cntt) / 2;
			cntt = 1;
		}
		else ++ cntt;
	}
//	puts("");
	printf(LLIO" ", ans);
	for(int i = f[n] + 1 ; i < f[n] + n + 1 ; ++ i) printf(LLIO" ", cnt[i]);
	return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>

#define M_PI       3.14159265358979323846

const int Z = 1024 * 512;

std::complex<long double> x[Z], y[Z], tmp[Z];
std::complex<long double> x2[Z], y2[Z];
int tab[Z];
long long odp[Z];

template<std::complex<long double>* x, std::complex<long double>* y, int wsp>
void fft(int n = Z, int p = 0, int s = 1, int q = 0) {
    if (n == 1) {
        y[q] = x[p];
        return;
    }
    std::complex<long double> en = std::exp(std::complex<long double>(0, wsp * 2 * M_PI / n)), e = 1;
    fft<x, y, wsp>(n / 2, p, s * 2, q);
    fft<x, y, wsp>(n / 2, p + s, s * 2, q + n / 2);
    for (int i = 0; i < n / 2; i++) {
        tmp[i] = y[i + q] + e * y[i + n / 2 + q];
        tmp[i + n / 2] = y[i + q] - e * y[i + n / 2 + q];
        e *= en;
    }
    memcpy(y + q, tmp, n * sizeof(std::complex<long double>));
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (long long) (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += (long long) ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    fft<x, y, 1>();
    fft<x2, y2, 1>();
    for (int i = 0; i < Z; i++)
        y[i] *= y2[i];
    fft<y, x, -1>();
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (int) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%lld ", odp[i]);
    return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>

#define M_PI       3.14159265358979323846

const int Z = 1024 * 512;

std::complex<double> x[Z], y[Z], tmp[Z];
std::complex<double> x2[Z], y2[Z];
int tab[Z];
int odp[Z];

template<std::complex<double>* x, std::complex<double>* y, int wsp>
void fft(int n = Z, int p = 0, int s = 1, int q = 0) {
    if (n == 1) {
        y[q] = x[p];
        return;
    }
    std::complex<double> en = std::exp(std::complex<double>(0, wsp * 2 * M_PI / n)), e = 1;
    fft<x, y, wsp>(n / 2, p, s * 2, q);
    fft<x, y, wsp>(n / 2, p + s, s * 2, q + n / 2);
    for (int i = 0; i < n / 2; i++) {
        tmp[i] = y[i + q] + e * y[i + n / 2 + q];
        tmp[i + n / 2] = y[i + q] - e * y[i + n / 2 + q];
        e *= en;
    }
    memcpy(y + q, tmp, n * sizeof(std::complex<double>));
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    fft<x, y, 1>();
    fft<x2, y2, 1>();
    for (int i = 0; i < Z; i++)
        y[i] *= y2[i];
    fft<y, x, -1>();
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (int) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%d ", odp[i]);
    return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>
#include <cmath>

const int Z = 1024 * 512;

std::complex<double> x[Z], y[Z], tmp[Z];
std::complex<double> x2[Z], y2[Z];
int tab[Z];
int odp[Z];

template<std::complex<double>* x, std::complex<double>* y, int wsp>
void fft(int n = Z, int p = 0, int s = 1, int q = 0) {
    if (n == 1) {
        y[q] = x[p];
        return;
    }
    std::complex<double> en = std::exp(std::complex<double>(0, wsp * 2 * M_PI / n)), e = 1;
    fft<x, y, wsp>(n / 2, p, s * 2, q);
    fft<x, y, wsp>(n / 2, p + s, s * 2, q + n / 2);
    for (int i = 0; i < n / 2; i++) {
        tmp[i] = y[i + q] + e * y[i + n / 2 + q];
        tmp[i + n / 2] = y[i + q] - e * y[i + n / 2 + q];
        e *= en;
    }
    memcpy(y + q, tmp, n * sizeof(std::complex<double>));
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    fft<x, y, 1>();
    fft<x2, y2, 1>();
    for (int i = 0; i < Z; i++)
        y[i] *= y2[i];
    fft<y, x, -1>();
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (int) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%d ", odp[i]);
    return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>

#define M_PI       3.14159265358979323846

const int Z = 1024 * 512;

std::complex<long double> x[Z], y[Z], tmp[Z];
std::complex<long double> x2[Z], y2[Z];
int tab[Z];
long long odp[Z];

template<std::complex<long double>* x, std::complex<long double>* y, int wsp>
void fft(int n = Z, int p = 0, int s = 1, int q = 0) {
    if (n == 1) {
        y[q] = x[p];
        return;
    }
    std::complex<long double> en = std::exp(std::complex<long double>(0, wsp * 2 * M_PI / n)), e = 1;
    fft<x, y, wsp>(n / 2, p, s * 2, q);
    fft<x, y, wsp>(n / 2, p + s, s * 2, q + n / 2);
    for (int i = 0; i < n / 2; i++) {
        tmp[i] = y[i + q] + e * y[i + n / 2 + q];
        tmp[i + n / 2] = y[i + q] - e * y[i + n / 2 + q];
        e *= en;
    }
    memcpy(y + q, tmp, n * sizeof(std::complex<long double>));
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (long long) (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += (long long) ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    fft<x, y, 1>();
    fft<x2, y2, 1>();
    for (int i = 0; i < Z; i++)
        y[i] *= y2[i];
    fft<y, x, -1>();
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (long long) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%lld ", odp[i]);
    return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>

#define pi       3.14159265358979323846

const int Z = 1024 * 512;

std::complex<double> x[Z], y[Z], tmp[Z];
std::complex<double> x2[Z], y2[Z];
int tab[Z];
long long odp[Z];

void fft(std::complex<double> *f, int g) {
    for (int i = 0, j = 0; i < Z; ++i) {
        if (i > j) swap(f[i], f[j]);
        for (int k = Z >> 1; (j ^= k) < k; k >>= 1);
    }
    for (int i = 1; i < Z; i <<= 1) {
        std::complex<double> w0 = (std::complex<double>) {cos(pi / i), sin(g * pi / i)};
        for (int j = 0; j < Z; j += i << 1) {
            std::complex<double> w = (std::complex<double>) {1, 0};
            for (int k = j; k < j + i; ++k) {
                std::complex<double> t = w * f[k + i];
                f[k + i] = f[k] - t;
                f[k] = f[k] + t;
                w = w * w0;
            }
        }
    }
//    if (g == -1) for (int i = 0; i < Z; ++i) f[i].real() /= Z;
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (long long) (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += (long long) ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<long double>(ile, 0);
            ile = 0;
        }
    }
    fft(x, 1);
    fft(x2, 1);
    for (int i = 0; i < Z; i++)
        x[i] *= x2[i];
    fft(x, -1);
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (long long) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%lld ", odp[i]);
    return 0;
}


#include <cstdio>
#include <complex>
#include <cstring>

const int Z = 1024 * 512;

std::complex<double> x[Z], y[Z], tmp[Z];
std::complex<double> x2[Z], y2[Z];
int tab[Z];
int odp[Z];

template<std::complex<double>* x, std::complex<double>* y, int wsp>
void fft(int n = Z, int p = 0, int s = 1, int q = 0) {
    if (n == 1) {
        y[q] = x[p];
        return;
    }
    std::complex<double> en = std::exp(std::complex<double>(0, wsp * 2 * M_PI / n)), e = 1;
    fft<x, y, wsp>(n / 2, p, s * 2, q);
    fft<x, y, wsp>(n / 2, p + s, s * 2, q + n / 2);
    for (int i = 0; i < n / 2; i++) {
        tmp[i] = y[i + q] + e * y[i + n / 2 + q];
        tmp[i + n / 2] = y[i + q] - e * y[i + n / 2 + q];
        e *= en;
    }
    memcpy(y + q, tmp, n * sizeof(std::complex<double>));
}

int main() {
    int N, X;
    scanf("%d%d", &N, &X);
    for (int i = 1; i <= N; i++) {
        scanf("%d", &tab[i]);
        tab[i] = (tab[i] < X);
    }
    int ter = 0;
    int ile = 0;
    for (int i = 1; i <= N; i++) {
        ile++;
        if (tab[i] == 1) {
            odp[0] += (ile - 1) * (ile) / 2;
            x[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    odp[0] += ile * (ile + 1) / 2;
    int jedynki = ter;
    ter = ile = 0;
    for (int i = N; i >= 1; i--) {
        ile++;
        if (tab[i] == 1) {
            x2[ter++] = std::complex<double>(ile, 0);
            ile = 0;
        }
    }
    fft<x, y, 1>();
    fft<x2, y2, 1>();
    for (int i = 0; i < Z; i++)
        y[i] *= y2[i];
    fft<y, x, -1>();
    for (int i = 0; i < jedynki; i++)
        odp[jedynki - i] = (int) std::round(x[i].real() / Z);
    for (int i = 0; i < N + 1; i++)
        printf("%d ", odp[i]);
    return 0;
}


#include<bits/stdc++.h>

using std::swap;
using std::cin;
using std::cout;

const double pi = acos(-1);
const long long mxk = 4e6 + 10;

struct complex {
    double real, imag;

    complex(double a = 0, double b = 0){real = a; imag = b;}

    complex operator +(const complex& b) const{
        complex ans(real + b.real, imag + b.imag);
        return ans;
    }

    complex operator -(const complex& b) const{
        complex ans(real - b.real, imag - b.imag);
        return ans;
    }

    complex operator *(const complex& b) const{
        complex ans(real * b.real - imag * b.imag, real * b.imag + imag * b.real);
        return ans;
    }

    complex operator +=(const complex& b ) {return *this = *this + b;}
    complex operator -=(const complex& b ) {return *this = *this - b;}
    complex operator *=(const complex& b ) {return *this = *this * b;}
} fa[mxk], fb[mxk];

long long m, n, rev[mxk];

void DFT(complex f[], long long len, long long flag) {
    for(long long i = 0; i < len; ++i)
        if(i < rev[i]) swap(f[i], f[rev[i]]);
    for(long long i = 1; i < len; i <<= 1) {
        complex ur(cos(pi / i), flag * sin(pi / i));
        for(long long j = 0; j < len; j += (i << 1)) {
            complex tmp(1, 0);
            for(long long k = 0; k < i; ++k, tmp *= ur) {
                complex fr = f[i + j + k], fl = f[j + k];
                f[j + k] = fl + tmp * fr;
                f[i + j + k] = fl - tmp * fr;
            }
        }
    }
}

long long x, f[mxk], ans0, cur;

int main() {
	cin >> n >> x;
	for(long long i = 1; i <= n; ++i)
		cin >> f[i];
	for(long long i = 1; i <= n; ++i)
		f[i] = f[i] < x;
	for(long long i = 1; i <= n; ++i)
		if(f[i] == 0) ++cur;
		else
			ans0 += cur * (cur + 1) / 2, cur = 0;
	ans0 += cur * (cur + 1) / 2;
	cout << ans0 << ' ';
	for(long long i = 1; i <= n; ++i)
		f[i] += f[i - 1];
	for(long long i = 0; i <= n; ++i)
		fa[f[i]].real += 1;
	for(long long i = 0; i <= n; ++i)
		fb[i].real = fa[n - i].real;
    long long len = 1, maxbit = 0;
    for(n += n; len <= n; len <<= 1, ++maxbit);
    for(long long i = 0; i < len; ++i)
        rev[i] = (rev[i >> 1] >> 1) | (i & 1) << (maxbit - 1);
    DFT(fa, len, 1);DFT(fb, len, 1);
    for(long long i = 0; i < len; ++i)
        fa[i] *= fb[i];
    DFT(fa, len, -1);
    for(long long i = (n) / 2 + 1; i <= n; ++i)
        printf("%.0lf ", fabs(fa[i].real / len));
}


#include<bits/stdc++.h>

using std::swap;
using std::cin;
using std::cout;

const double pi = acos(-1);
const int mxk = 4e6 + 10;

struct complex {
    double real, imag;

    complex(double a = 0, double b = 0){real = a; imag = b;}

    complex operator +(const complex& b) const{
        complex ans(real + b.real, imag + b.imag);
        return ans;
    }

    complex operator -(const complex& b) const{
        complex ans(real - b.real, imag - b.imag);
        return ans;
    }

    complex operator *(const complex& b) const{
        complex ans(real * b.real - imag * b.imag, real * b.imag + imag * b.real);
        return ans;
    }

    complex operator +=(const complex& b ) {return *this = *this + b;}
    complex operator -=(const complex& b ) {return *this = *this - b;}
    complex operator *=(const complex& b ) {return *this = *this * b;}
} fa[mxk], fb[mxk];

int m, n, rev[mxk];

void DFT(complex f[], int len, int flag) {
    for(int i = 0; i < len; ++i)
        if(i < rev[i]) swap(f[i], f[rev[i]]);
    for(int i = 1; i < len; i <<= 1) {
        complex ur(cos(pi / i), flag * sin(pi / i));
        for(int j = 0; j < len; j += (i << 1)) {
            complex tmp(1, 0);
            for(int k = 0; k < i; ++k, tmp *= ur) {
                complex fr = f[i + j + k], fl = f[j + k];
                f[j + k] = fl + tmp * fr;
                f[i + j + k] = fl - tmp * fr;
            }
        }
    }
}

int x, f[mxk], ans0, cur;

int main() {
	cin >> n >> x;
	for(int i = 1; i <= n; ++i)
		cin >> f[i];
	for(int i = 1; i <= n; ++i)
		f[i] = f[i] < x;
	for(int i = 1; i <= n; ++i)
		if(f[i] == 0) ++cur;
		else
			ans0 += cur * (cur + 1) / 2, cur = 0;
	ans0 += cur * (cur + 1) / 2;
	cout << ans0 << ' ';
	for(int i = 1; i <= n; ++i)
		f[i] += f[i - 1];
	for(int i = 0; i <= n; ++i)
		fa[f[i]].real += 1;
	for(int i = 0; i <= n; ++i)
		fb[i].real = fa[n - i].real;
    int len = 1, maxbit = 0;
    for(n += n; len <= n; len <<= 1, ++maxbit);
    for(int i = 0; i < len; ++i)
        rev[i] = (rev[i >> 1] >> 1) | (i & 1) << (maxbit - 1);
    DFT(fa, len, 1);DFT(fb, len, 1);
    for(int i = 0; i < len; ++i)
        fa[i] *= fb[i];
    DFT(fa, len, -1);
    for(int i = (n) / 2 + 1; i <= n; ++i)
        printf("%.0lf ", fabs(fa[i].real / len));
}


#include<bits/stdc++.h>

using namespace std;

const long long p = 998244353;
const long long g = 3, gi = 332748118;
const int mxk = 5e5 + 10;

inline long long power(long long a, long long b) {
	long long ans = 1, base = a;
	while(b) {
		if(b & 1) ans = ans * base % p;
		base = base * base % p;
		b >>= 1;
	}
	return ans;
}

long long m, n, rev[mxk], fa[mxk], fb[mxk];

void DFT(long long  f[], int len, int flag) {
    for(int i = 0; i < len; ++i)
        if(i < rev[i]) swap(f[i], f[rev[i]]);
    for(int i = 1; i < len; i <<= 1) {
    	long long ur = power(flag ? g : gi, (p - 1) / (i << 1));
        for(int j = 0; j < len; j += (i << 1)) {
            long long tmp = 1;
            for(int k = 0; k < i; ++k, tmp = tmp * ur % p) {
                long long fr = f[i + j + k], fl = f[j + k];
                f[j + k] = (fl + tmp * fr % p) % p;
                f[i + j + k] = (fl - tmp * fr % p + p) % p;
            }
        }
    }
	if(!flag) {
		long long len_inv = power(len, p - 2);
		for(int i = 0; i < len; ++i) f[i] = f[i] * len_inv % p;
	}
}

int init(int n) {
    int len = 1, maxbit = 0;
    for(; len <= n; len <<= 1, ++maxbit);
    for(int i = 0; i < len; ++i)
        rev[i] = (rev[i >> 1] >> 1) | (i & 1) << (maxbit - 1);
	return len;
}

long long a[mxk], x, ans0, cur;

int main() {
	cin >> n >> x;
	for(int i = 1; i <= n; ++i)
		cin >> fa[i];
	for(int i = 1; i <= n; ++i)
		fa[i] = fa[i] < x;
	for(int i = 1; i <= n; ++i)
		if(fa[i] == 0) ++cur;
		else
			ans0 += cur * (cur + 1) / 2, cur = 0;
	ans0 += cur * (cur + 1) / 2;
	cout << ans0 << ' ';
	for(int i = 1; i <= n; ++i)
		fa[i] += fa[i - 1];
	for(int i = 0; i <= n; ++i)
		++fb[fa[i]];
	for(int i = 0; i <= n; ++i)
		fa[i] = fb[n - i];
	fb[0] += 1;
	int len = init(n + n);
	DFT(fa, len, 1); DFT(fb, len, 1);
	for(int i = 0; i < len; ++i)
		fa[i] = fa[i] * fb[i] % p;
	DFT(fa, len, 0);
	for(int i = n + 1; i <= n + n; ++i)
		cout << fa[i] << ' ';
	cout << endl;
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define db double
#pragma G++ optimize(2)
using namespace std;
const int M=1e6+10;
const db pi=acos(-1);
struct complex{
    db x,y;
    complex(){}
    complex(db a,db b):x(a),y(b){}
}A[M];
complex operator +(complex a,complex b){return complex(a.x+b.x,a.y+b.y);}
complex operator -(complex a,complex b){return complex(a.x-b.x,a.y-b.y);}
complex operator *(complex a,complex b){return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
int R[M];
void DFT(complex *a,int n,int f){
    for(int i=0;i<=n;i++)if(i<R[i])swap(a[i],a[R[i]]);
    for(int i=2;i<=n;i<<=1){
        int now=i>>1;
        complex wn=complex(cos(2*pi/i),f*sin(2*pi/i));
        for(int j=0;j<n;j+=i){
            complex w=complex(1,0),x,y;
            for(int k=j;k<j+now;k++,w=w*wn){
                x=a[k],y=w*a[k+now];
                a[k]=x+y;a[k+now]=x-y;
            }
        }
    }
    if(f==-1)for(int i=0;i<=n;i++)a[i].y/=(2*n);
}
void FFT(complex *a,int n,int m){
    int K,lg;
    for(K=1,lg=0;K<=n+m;K<<=1,++lg);--lg;
    for(int i=0;i<=K;i++)R[i]=(R[i>>1]>>1)|((i&1)<<lg);
    DFT(a,K,1);
    for(int i=0;i<=K;i++)a[i]=a[i]*a[i];
    DFT(a,K,-1);
}
int n,x,a;
int Bef[M],Cnt[M];
int main(){
	scanf("%d%d",&n,&x);
	++Cnt[0];
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		Bef[i]=Bef[i-1]+(a<x);
		++Cnt[Bef[i]];
	}
	for(int i=0;i<=n;i++)A[i]=complex(Cnt[i],Cnt[n-i]);
	FFT(A,n,n);
	A[n].y=(A[n].y-n-1)/2.0;
	for(int i=n;i<=n+n;i++)printf("%I64d ",(long long)(A[i].y+0.5));
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define db double
#pragma G++ optimize(2)
using namespace std;
const int M=4e5+10;
const db pi=acos(-1);
struct complex{
    db x,y;
    complex(){}
    complex(db a,db b):x(a),y(b){}
}A[M];
complex operator +(complex a,complex b){return complex(a.x+b.x,a.y+b.y);}
complex operator -(complex a,complex b){return complex(a.x-b.x,a.y-b.y);}
complex operator *(complex a,complex b){return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
int R[M];
void DFT(complex *a,int n,int f){
    for(int i=0;i<=n;i++)if(i<R[i])swap(a[i],a[R[i]]);
    for(int i=2;i<=n;i<<=1){
        int now=i>>1;
        complex wn=complex(cos(2*pi/i),f*sin(2*pi/i));
        for(int j=0;j<n;j+=i){
            complex w=complex(1,0),x,y;
            for(int k=j;k<j+now;k++,w=w*wn){
                x=a[k],y=w*a[k+now];
                a[k]=x+y;a[k+now]=x-y;
            }
        }
    }
    if(f==-1)for(int i=0;i<=n;i++)a[i].y/=(2*n);
}
void FFT(complex *a,int n,int m){
    int K,lg;
    for(K=1,lg=0;K<=n+m;K<<=1,++lg);--lg;
    for(int i=0;i<=K;i++)R[i]=(R[i>>1]>>1)|((i&1)<<lg);
    DFT(a,K,1);
    for(int i=0;i<=K;i++)a[i]=a[i]*a[i];
    DFT(a,K,-1);
}
int n,x,a;
int Bef[M],Cnt[M];
int main(){
	scanf("%d%d",&n,&x);
	++Cnt[0];
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		Bef[i]=Bef[i-1]+(a<x);
		++Cnt[Bef[i]];
	}
	for(int i=0;i<=n;i++)A[i]=complex(Cnt[i],Cnt[n-i]);
	FFT(A,n,n);
	A[n].y=(A[n].y-n-1)/2.0;
	for(int i=n;i<=n+n;i++)printf("%I64d ",(long long)(A[i].y+0.5));
	return 0;
}


#include<cmath>
#include<cstdio>
#include<cstring>
#include<algorithm>
#define db double
using namespace std;
const int M=6e5+10;
const db pi=acos(-1);
struct complex{
    db x,y;
    complex(){}
    complex(db a,db b):x(a),y(b){}
}A[M];
complex operator +(complex a,complex b){return complex(a.x+b.x,a.y+b.y);}
complex operator -(complex a,complex b){return complex(a.x-b.x,a.y-b.y);}
complex operator *(complex a,complex b){return complex(a.x*b.x-a.y*b.y,a.x*b.y+a.y*b.x);}
int R[M];
void DFT(complex *a,int n,int f){
    for(int i=0;i<=n;i++)if(i<R[i])swap(a[i],a[R[i]]);
    for(int i=2;i<=n;i<<=1){
        int now=i>>1;
        complex wn=complex(cos(2*pi/i),f*sin(2*pi/i));
        for(int j=0;j<n;j+=i){
            complex w=complex(1,0),x,y;
            for(int k=j;k<j+now;k++,w=w*wn){
                x=a[k],y=w*a[k+now];
                a[k]=x+y;a[k+now]=x-y;
            }
        }
    }
    if(f==-1)for(int i=0;i<=n;i++)a[i].y/=(2*n);
}
void FFT(complex *a,int n,int m){
    int K,lg;
    for(K=1,lg=0;K<=n+m;K<<=1,++lg);--lg;
    for(int i=0;i<=K;i++)R[i]=(R[i>>1]>>1)|((i&1)<<lg);
    DFT(a,K,1);
    for(int i=0;i<=K;i++)a[i]=a[i]*a[i];
    DFT(a,K,-1);
}
int n,x,a;
int Bef[M],Cnt[M];
int main(){
	scanf("%d%d",&n,&x);
	++Cnt[0];
	for(int i=1;i<=n;i++){
		scanf("%d",&a);
		Bef[i]=Bef[i-1]+(a<x);
		++Cnt[Bef[i]];
	}
	for(int i=0;i<=n;i++)A[i]=complex(Cnt[i],Cnt[n-i]);
	FFT(A,n,n);
	A[n].y=(A[n].y-n-1)/2.0;
	for(int i=n;i<=n+n;i++)printf("%I64d ",(long long)(A[i].y+0.5));
	return 0;
}


//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<sstream>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<fstream>
#include<numeric>
#include<iomanip>
#include<bitset>
#include<list>
#include<stdexcept>
#include<functional>
#include<utility>
#include<ctime>
#include<cassert>
using namespace std;
#define RI(X) scanf("%d", &(X))
#define DRI(X) int (X); scanf("%d", &X)
#define rep(i,a,n) for(int i=(a);i<(int)(n);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define MP make_pair
#define PB push_back
#define AA first
#define BB second
#define OP begin()
#define ED end()
#define SZ size()
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
#define cmin(x,y) x=min(x,y)
#define cmax(x,y) x=max(x,y)
const LL MOD = 1000000007;
const long double PI = acos(-1.);
const long double eps = 1e-9;
LL modPow(LL a,LL b,LL MOD){
    LL ret=1;for(;b;b>>=1){
        if(b&1)ret=ret*a%MOD;a=a*a%MOD;
    }return ret;
}
//FFT
//> 验题: NEERC 2013 Eastern subregional G

const int MXN = 1 << 20;
long double ax[MXN], ay[MXN];
long double bx[MXN], by[MXN];
long double ansx[MXN], ansy[MXN];
int revv(int x, int mask) {
    int ret = 0;
    for (int i = 0; i < mask; i++) {
        ret <<= 1;
        ret |= x & 1;
        x >>= 1;
    }
    return ret;
}
void fft(long double * rl, long double * ig, int n, bool sign) {
    int d = 0;
    while ((1 << d) < n) ++d;
    for (int i = 0; i < n; i++) {
        int j = revv(i, d);
        if (i < j) swap(rl[i], rl[j]), swap(ig[i], ig[j]);
    }
    for (int m = 2; m <= n; m <<= 1) {
        int mh = m >> 1;
        long double _wr = cos(2 * PI / m), _wi = sin(2 * PI / m);
        if (sign) _wi *= -1.0;
        for (int i = 0; i < n; i += m) {
            long double wr = 1, wi = 0;
            for (int j = i; j < mh + i; j++) {
                int k = j + mh;
                long double er = rl[k] * wr - ig[k] * wi;
                long double ei = rl[k] * wi + ig[k] * wr;
                long double cr = rl[j], ci = ig[j];
                rl[j] += er, ig[j] += ei;
                rl[k] = cr - er, ig[k] = ci - ei;
                long double qr = wr * _wr - wi * _wi;
                long double qi = wr * _wi + wi * _wr;
                wr = qr, wi = qi;
            }
        }
    }
    if (sign) for (int i = 0; i < n; i++)
            rl[i] /= n, ig[i] /= n;
}
int fftmultiply(int *a, int la, int *b, int lb, LL *ans) {
    int lans = max(la, lb), ln = 0, i;
    while ((1 << ln) < lans) ++ln;
    lans = 2 << ln;
    for (i = 0; i < lans; i++)
        ax[i] = i < la ? a[i] : 0, ay[i] = 0;
    fft(ax, ay, lans, 0);
    for (i = 0; i < lans; i++)
        bx[i] = i < lb ? b[i] : 0, by[i] = 0;
    fft(bx, by, lans, 0);
    for (i = 0; i < lans; i++) {
        ansx[i] = ax[i] * bx[i] - ay[i] * by[i];
        ansy[i] = ax[i] * by[i] + ay[i] * bx[i];
    }
    fft(ansx, ansy, lans, 1);
    for (i = 0; i < lans; i++)
        ans[i] = ansx[i] + 0.5;
    return lans;
}

int P[MXN],Q[MXN];
int a[MXN],b[MXN];
LL ans[MXN];
void solve(){
    int n,x,_;
    cin>>n>>x;
    VI A;
    rep(i,0,n){cin>>_;if(_>=x)A.PB(0);else A.PB(1);}
    // rep(i,0,n)cout<<A[i]<<" ";cout<<"\n";
    rep(i,0,n+1)P[i]=Q[i]=0;
    int s=0;
    rep(i,0,n){
        P[s]+=1;
        s+=A[i];
        Q[s]+=1;
    }
    int la,lb;
    la=lb=n+2;
    rep(i,0,la)a[i]=b[i]=0;
    rep(i,0,n+1)a[i]=Q[i];
    rep(i,0,n+1)b[n-i]=P[i];
    // rep(i,0,la)cout<<a[i]<<","<<i<<" ";cout<<"\n";
    // rep(i,0,lb)cout<<b[i]<<","<<i<<" ";cout<<"\n";
    int lans=fftmultiply(a,la,b,lb,ans);
    // rep(i,0,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
    int l0=0;
    int f0=0;
    rep(i,0,n){
        if(A[i]==0)l0+=1;
        else{
            f0+=1LL*(l0+1)*l0/2;
            la=0;
        }
    }
    f0+=1LL*(l0+1)*l0/2;
    cout<<f0<<" ";
    rep(i,n+1,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
}

int main(){
    int _T=1;
    //scanf("%d",&_T);
    rep(CA,0,_T){
        //printf("Case #%d: ",CA+1);
        solve();
    }
    return 0;
}


//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<sstream>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<fstream>
#include<numeric>
#include<iomanip>
#include<bitset>
#include<list>
#include<stdexcept>
#include<functional>
#include<utility>
#include<ctime>
#include<cassert>
using namespace std;
#define RI(X) scanf("%d", &(X))
#define DRI(X) int (X); scanf("%d", &X)
#define rep(i,a,n) for(int i=(a);i<(int)(n);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define MP make_pair
#define PB push_back
#define AA first
#define BB second
#define OP begin()
#define ED end()
#define SZ size()
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
#define cmin(x,y) x=min(x,y)
#define cmax(x,y) x=max(x,y)
const LL MOD = 1000000007;
const long double PI = acos(-1.);
const long double eps = 1e-9;
LL modPow(LL a,LL b,LL MOD){
    LL ret=1;for(;b;b>>=1){
        if(b&1)ret=ret*a%MOD;a=a*a%MOD;
    }return ret;
}
//FFT
//> 验题: NEERC 2013 Eastern subregional G

const int MXN = 1 << 20;
long double ax[MXN], ay[MXN];
long double bx[MXN], by[MXN];
long double ansx[MXN], ansy[MXN];
int revv(int x, int mask) {
    int ret = 0;
    for (int i = 0; i < mask; i++) {
        ret <<= 1;
        ret |= x & 1;
        x >>= 1;
    }
    return ret;
}
void fft(long double * rl, long double * ig, int n, bool sign) {
    int d = 0;
    while ((1 << d) < n) ++d;
    for (int i = 0; i < n; i++) {
        int j = revv(i, d);
        if (i < j) swap(rl[i], rl[j]), swap(ig[i], ig[j]);
    }
    for (int m = 2; m <= n; m <<= 1) {
        int mh = m >> 1;
        long double _wr = cos(2 * PI / m), _wi = sin(2 * PI / m);
        if (sign) _wi *= -1.0;
        for (int i = 0; i < n; i += m) {
            long double wr = 1, wi = 0;
            for (int j = i; j < mh + i; j++) {
                int k = j + mh;
                long double er = rl[k] * wr - ig[k] * wi;
                long double ei = rl[k] * wi + ig[k] * wr;
                long double cr = rl[j], ci = ig[j];
                rl[j] += er, ig[j] += ei;
                rl[k] = cr - er, ig[k] = ci - ei;
                long double qr = wr * _wr - wi * _wi;
                long double qi = wr * _wi + wi * _wr;
                wr = qr, wi = qi;
            }
        }
    }
    if (sign) for (int i = 0; i < n; i++)
            rl[i] /= n, ig[i] /= n;
}
int fftmultiply(int *a, int la, int *b, int lb, LL *ans) {
    int lans = max(la, lb), ln = 0, i;
    while ((1 << ln) < lans) ++ln;
    lans = 2 << ln;
    for (i = 0; i < lans; i++)
        ax[i] = i < la ? a[i] : 0, ay[i] = 0;
    fft(ax, ay, lans, 0);
    for (i = 0; i < lans; i++)
        bx[i] = i < lb ? b[i] : 0, by[i] = 0;
    fft(bx, by, lans, 0);
    for (i = 0; i < lans; i++) {
        ansx[i] = ax[i] * bx[i] - ay[i] * by[i];
        ansy[i] = ax[i] * by[i] + ay[i] * bx[i];
    }
    fft(ansx, ansy, lans, 1);
    for (i = 0; i < lans; i++)
        ans[i] = ansx[i] + 0.5;
    return lans;
}

int P[MXN],Q[MXN];
int a[MXN],b[MXN];
LL ans[MXN];
void solve(){
    int n,x,_;
    cin>>n>>x;
    VI A;
    rep(i,0,n){cin>>_;if(_>=x)A.PB(0);else A.PB(1);}
    // rep(i,0,n)cout<<A[i]<<" ";cout<<"\n";
    rep(i,0,n+1)P[i]=Q[i]=0;
    int s=0;
    rep(i,0,n){
        P[s]+=1;
        s+=A[i];
        Q[s]+=1;
    }
    int la,lb;
    la=lb=n+2;
    rep(i,0,la)a[i]=b[i]=0;
    rep(i,0,n+1)a[i]=Q[i];
    rep(i,0,n+1)b[n-i]=P[i];
    // rep(i,0,la)cout<<a[i]<<","<<i<<" ";cout<<"\n";
    // rep(i,0,lb)cout<<b[i]<<","<<i<<" ";cout<<"\n";
    int lans=fftmultiply(a,la,b,lb,ans);
    // rep(i,0,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
    LL l0=0;
    LL f0=0;
    rep(i,0,n){
        if(A[i]==0)l0+=1;
        else{
            f0+=1LL*(l0+1)*l0/2;
            l0=0;
        }
    }
    f0+=1LL*(l0+1)*l0/2;
    cout<<f0<<" ";
    rep(i,n+1,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
}

int main(){
    int _T=1;
    //scanf("%d",&_T);
    rep(CA,0,_T){
        //printf("Case #%d: ",CA+1);
        solve();
    }
    return 0;
}


//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<sstream>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<fstream>
#include<numeric>
#include<iomanip>
#include<bitset>
#include<list>
#include<stdexcept>
#include<functional>
#include<utility>
#include<ctime>
#include<cassert>
using namespace std;
#define RI(X) scanf("%d", &(X))
#define DRI(X) int (X); scanf("%d", &X)
#define rep(i,a,n) for(int i=(a);i<(int)(n);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define MP make_pair
#define PB push_back
#define AA first
#define BB second
#define OP begin()
#define ED end()
#define SZ size()
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
#define cmin(x,y) x=min(x,y)
#define cmax(x,y) x=max(x,y)
const LL MOD = 1000000007;
const double PI = acos(-1.);
const double eps = 1e-9;
LL modPow(LL a,LL b,LL MOD){
    LL ret=1;for(;b;b>>=1){
        if(b&1)ret=ret*a%MOD;a=a*a%MOD;
    }return ret;
}
//FFT
//> 验题: NEERC 2013 Eastern subregional G

const int MXN = 1 << 20;
double ax[MXN], ay[MXN];
double bx[MXN], by[MXN];
double ansx[MXN], ansy[MXN];
int revv(int x, int mask) {
    int ret = 0;
    for (int i = 0; i < mask; i++) {
        ret <<= 1;
        ret |= x & 1;
        x >>= 1;
    }
    return ret;
}
void fft(double * rl, double * ig, int n, bool sign) {
    int d = 0;
    while ((1 << d) < n) ++d;
    for (int i = 0; i < n; i++) {
        int j = revv(i, d);
        if (i < j) swap(rl[i], rl[j]), swap(ig[i], ig[j]);
    }
    for (int m = 2; m <= n; m <<= 1) {
        int mh = m >> 1;
        double _wr = cos(2 * PI / m), _wi = sin(2 * PI / m);
        if (sign) _wi *= -1.0;
        for (int i = 0; i < n; i += m) {
            double wr = 1, wi = 0;
            for (int j = i; j < mh + i; j++) {
                int k = j + mh;
                double er = rl[k] * wr - ig[k] * wi;
                double ei = rl[k] * wi + ig[k] * wr;
                double cr = rl[j], ci = ig[j];
                rl[j] += er, ig[j] += ei;
                rl[k] = cr - er, ig[k] = ci - ei;
                double qr = wr * _wr - wi * _wi;
                double qi = wr * _wi + wi * _wr;
                wr = qr, wi = qi;
            }
        }
    }
    if (sign) for (int i = 0; i < n; i++)
            rl[i] /= n, ig[i] /= n;
}
int fftmultiply(int *a, int la, int *b, int lb, LL *ans) {
    int lans = max(la, lb), ln = 0, i;
    while ((1 << ln) < lans) ++ln;
    lans = 2 << ln;
    for (i = 0; i < lans; i++)
        ax[i] = i < la ? a[i] : 0, ay[i] = 0;
    fft(ax, ay, lans, 0);
    for (i = 0; i < lans; i++)
        bx[i] = i < lb ? b[i] : 0, by[i] = 0;
    fft(bx, by, lans, 0);
    for (i = 0; i < lans; i++) {
        ansx[i] = ax[i] * bx[i] - ay[i] * by[i];
        ansy[i] = ax[i] * by[i] + ay[i] * bx[i];
    }
    fft(ansx, ansy, lans, 1);
    for (i = 0; i < lans; i++)
        ans[i] = ansx[i] + 0.5;
    return lans;
}

int P[MXN],Q[MXN];
int a[MXN],b[MXN];
LL ans[MXN];
void solve(){
    int n,x,_;
    cin>>n>>x;
    VI A;
    rep(i,0,n){cin>>_;if(_>=x)A.PB(0);else A.PB(1);}
    // rep(i,0,n)cout<<A[i]<<" ";cout<<"\n";
    rep(i,0,n+1)P[i]=Q[i]=0;
    int s=0;
    rep(i,0,n){
        P[s]+=1;
        s+=A[i];
        Q[s]+=1;
    }
    int la,lb;
    la=lb=n+2;
    rep(i,0,la)a[i]=b[i]=0;
    rep(i,0,n+1)a[i]=Q[i];
    rep(i,0,n+1)b[n-i]=P[i];
    // rep(i,0,la)cout<<a[i]<<","<<i<<" ";cout<<"\n";
    // rep(i,0,lb)cout<<b[i]<<","<<i<<" ";cout<<"\n";
    int lans=fftmultiply(a,la,b,lb,ans);
    // rep(i,0,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
    int l0=0;
    int f0=0;
    rep(i,0,n){
        if(A[i]==0)l0+=1;
        else{
            f0+=1LL*(l0+1)*l0/2;
            la=0;
        }
    }
    f0+=1LL*(l0+1)*l0/2;
    cout<<f0<<" ";
    rep(i,n+1,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
}

int main(){
    int _T=1;
    //scanf("%d",&_T);
    rep(CA,0,_T){
        //printf("Case #%d: ",CA+1);
        solve();
    }
    return 0;
}


//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include<cstdlib>
#include<cctype>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<sstream>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<fstream>
#include<numeric>
#include<iomanip>
#include<bitset>
#include<list>
#include<stdexcept>
#include<functional>
#include<utility>
#include<ctime>
#include<cassert>
using namespace std;
#define RI(X) scanf("%d", &(X))
#define DRI(X) int (X); scanf("%d", &X)
#define rep(i,a,n) for(int i=(a);i<(int)(n);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define MP make_pair
#define PB push_back
#define AA first
#define BB second
#define OP begin()
#define ED end()
#define SZ size()
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
#define cmin(x,y) x=min(x,y)
#define cmax(x,y) x=max(x,y)
const LL MOD = 1000000007;
const long double PI = acos(-1.);
const long double eps = 1e-9;
LL modPow(LL a,LL b,LL MOD){
    LL ret=1;for(;b;b>>=1){
        if(b&1)ret=ret*a%MOD;a=a*a%MOD;
    }return ret;
}
//FFT
//> 验题: NEERC 2013 Eastern subregional G

const int MXN = 1 << 20;
long double ax[MXN], ay[MXN];
long double bx[MXN], by[MXN];
long double ansx[MXN], ansy[MXN];
int revv(int x, int mask) {
    int ret = 0;
    for (int i = 0; i < mask; i++) {
        ret <<= 1;
        ret |= x & 1;
        x >>= 1;
    }
    return ret;
}
void fft(long double * rl, long double * ig, int n, bool sign) {
    int d = 0;
    while ((1 << d) < n) ++d;
    for (int i = 0; i < n; i++) {
        int j = revv(i, d);
        if (i < j) swap(rl[i], rl[j]), swap(ig[i], ig[j]);
    }
    for (int m = 2; m <= n; m <<= 1) {
        int mh = m >> 1;
        long double _wr = cos(2 * PI / m), _wi = sin(2 * PI / m);
        if (sign) _wi *= -1.0;
        for (int i = 0; i < n; i += m) {
            long double wr = 1, wi = 0;
            for (int j = i; j < mh + i; j++) {
                int k = j + mh;
                long double er = rl[k] * wr - ig[k] * wi;
                long double ei = rl[k] * wi + ig[k] * wr;
                long double cr = rl[j], ci = ig[j];
                rl[j] += er, ig[j] += ei;
                rl[k] = cr - er, ig[k] = ci - ei;
                long double qr = wr * _wr - wi * _wi;
                long double qi = wr * _wi + wi * _wr;
                wr = qr, wi = qi;
            }
        }
    }
    if (sign) for (int i = 0; i < n; i++)
            rl[i] /= n, ig[i] /= n;
}
int fftmultiply(int *a, int la, int *b, int lb, LL *ans) {
    int lans = max(la, lb), ln = 0, i;
    while ((1 << ln) < lans) ++ln;
    lans = 2 << ln;
    for (i = 0; i < lans; i++)
        ax[i] = i < la ? a[i] : 0, ay[i] = 0;
    fft(ax, ay, lans, 0);
    for (i = 0; i < lans; i++)
        bx[i] = i < lb ? b[i] : 0, by[i] = 0;
    fft(bx, by, lans, 0);
    for (i = 0; i < lans; i++) {
        ansx[i] = ax[i] * bx[i] - ay[i] * by[i];
        ansy[i] = ax[i] * by[i] + ay[i] * bx[i];
    }
    fft(ansx, ansy, lans, 1);
    for (i = 0; i < lans; i++)
        ans[i] = ansx[i] + 0.5;
    return lans;
}

int P[MXN],Q[MXN];
int a[MXN],b[MXN];
LL ans[MXN];
void solve(){
    int n,x,_;
    cin>>n>>x;
    VI A;
    rep(i,0,n){cin>>_;if(_>=x)A.PB(0);else A.PB(1);}
    // rep(i,0,n)cout<<A[i]<<" ";cout<<"\n";
    rep(i,0,n+1)P[i]=Q[i]=0;
    int s=0;
    rep(i,0,n){
        P[s]+=1;
        s+=A[i];
        Q[s]+=1;
    }
    int la,lb;
    la=lb=n+2;
    rep(i,0,la)a[i]=b[i]=0;
    rep(i,0,n+1)a[i]=Q[i];
    rep(i,0,n+1)b[n-i]=P[i];
    // rep(i,0,la)cout<<a[i]<<","<<i<<" ";cout<<"\n";
    // rep(i,0,lb)cout<<b[i]<<","<<i<<" ";cout<<"\n";
    int lans=fftmultiply(a,la,b,lb,ans);
    // rep(i,0,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
    int l0=0;
    int f0=0;
    rep(i,0,n){
        if(A[i]==0)l0+=1;
        else{
            f0+=1LL*(l0+1)*l0/2;
            l0=0;
        }
    }
    f0+=1LL*(l0+1)*l0/2;
    cout<<f0<<" ";
    rep(i,n+1,n+n+1)cout<<ans[i]<<" ";cout<<"\n";
}

int main(){
    int _T=1;
    //scanf("%d",&_T);
    rep(CA,0,_T){
        //printf("Case #%d: ",CA+1);
        solve();
    }
    return 0;
}


#include <bits/stdc++.h>
#define N 800005
using namespace std;
typedef long long LL;
const double pi = acos(-1.0);
struct Complex{
	double x, y;
}a[N];
int rev[N], s[N], n, f[N], ans[N], b[N], p[N], g[N], limit = 1, len, cnt;
int read(){
	int x, f = 1;
	char ch;
	while(ch = getchar(), ch < '0' || ch > '9') if(ch == '-') f = -1;
	x = ch - 48;
	while(ch = getchar(), ch >= '0' && ch <= '9') x = x * 10 + ch - 48;
	return x * f;
}
Complex operator + (Complex a, Complex b){ return Complex{a.x + b.x, a.y + b.y};}
Complex operator - (Complex a, Complex b){ return Complex{a.x - b.x, a.y - b.y};}
Complex operator * (Complex a, Complex b){ return Complex{a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x};};
void fft(Complex *a, int type){
	int i, j, k, mid, R;
	for(i = 0; i < limit; i++){
		if(i < rev[i]) swap(a[i], a[rev[i]]);
	}
	for(mid = 1; mid < limit; mid <<= 1){
		Complex Wn = Complex{cos(pi / mid), type * sin(pi / mid)};
		for(R = (mid << 1), j = 0; j < limit; j += R){
			Complex w = Complex{1, 0};
			for(k = 0; k < mid; k++, w = w * Wn){
				Complex x = a[j + k], y = a[j + k + mid] * w;
				a[j + k] = x + y;
				a[j + k + mid] = x - y;
			}
		}
	}
}
void init(int n, int m){
	while(limit <= n + m) limit <<= 1, len++;
	for(int i = 0; i < limit; i++){
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (len - 1));
	}
}
LL get0(){
	int i, j, p = 0;
	LL ret = 0;
	for(i = 1; i <= n; i++){
		if(s[i] != s[i - 1]) p = i;
		ret += i - p;
	}
	return ret;
}
int main(){
	int i, j, k, m, x, sum = 0;
	scanf("%d%d", &n, &x);
	f[0]++;
	for(i = 1; i <= n; i++){
		scanf("%d", &j);
		sum += (j < x); s[i] = sum;
		f[sum]++;
	}
	//printf("%d\n", sum);
	//for(i = 1; i <= cnt; i++) printf("%d ", p[i]);
	//printf("\n");
	for(i = 0; i <= n; i++) g[i] = f[n - i];
	for(i = 0; i <= n; i++) a[i].x = f[i], a[i].y = g[i];
	init(n, n);
	fft(a, 1);
	for(i = 0; i < limit; i++) a[i] = a[i] * a[i];
	fft(a, -1);
	printf("%lld ", get0());
	for(i = n - 1; i >= 0; i--){
		printf("%lld ", LL(a[i].y / (2 * limit) + 0.5));
	}
	/*for(i = 0; i < cnt; i++) g[i] = p[cnt - i - 1];
	cnt--;
	for(i = 0; i <= cnt; i++) a[i].x = p[i], a[i].y = g[i];
	init(cnt, cnt);
	fft(a, 1);
	for(i = 0; i < limit; i++) a[i] = a[i] * a[i];
	fft(a, -1);*/

	return 0;
}


#include <bits/stdc++.h>
#define N 800005
using namespace std;
typedef long long LL;
const double pi = acos(-1.0);
struct Complex{
	double x, y;
}a[N];
int rev[N], s[N], n, f[N], ans[N], b[N], p[N], g[N], limit = 1, len, cnt;
int read(){
	int x, f = 1;
	char ch;
	while(ch = getchar(), ch < '0' || ch > '9') if(ch == '-') f = -1;
	x = ch - 48;
	while(ch = getchar(), ch >= '0' && ch <= '9') x = x * 10 + ch - 48;
	return x * f;
}
Complex operator + (Complex a, Complex b){ return Complex{a.x + b.x, a.y + b.y};}
Complex operator - (Complex a, Complex b){ return Complex{a.x - b.x, a.y - b.y};}
Complex operator * (Complex a, Complex b){ return Complex{a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x};};
void fft(Complex *a, int type){
	int i, j, k, mid, R;
	for(i = 0; i < limit; i++){
		if(i < rev[i]) swap(a[i], a[rev[i]]);
	}
	for(mid = 1; mid < limit; mid <<= 1){
		Complex Wn = Complex{cos(pi / mid), type * sin(pi / mid)};
		for(R = (mid << 1), j = 0; j < limit; j += R){
			Complex w = Complex{1, 0};
			for(k = 0; k < mid; k++, w = w * Wn){
				Complex x = a[j + k], y = a[j + k + mid] * w;
				a[j + k] = x + y;
				a[j + k + mid] = x - y;
			}
		}
	}
}
void init(int n, int m){
	while(limit <= n + m) limit <<= 1, len++;
	for(int i = 0; i < limit; i++){
		rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (len - 1));
	}
}
int get0(){
	int i, j, ret = 0, p = 0;
	for(i = 1; i <= n; i++){
		if(s[i] != s[i - 1]) p = i;
		ret += i - p;
	}
	return ret;
}
int main(){
	int i, j, k, m, x, sum = 0;
	scanf("%d%d", &n, &x);
	f[0]++;
	for(i = 1; i <= n; i++){
		scanf("%d", &j);
		sum += (j < x); s[i] = sum;
		f[sum]++;
	}
	//printf("%d\n", sum);
	//for(i = 1; i <= cnt; i++) printf("%d ", p[i]);
	//printf("\n");
	for(i = 0; i <= n; i++) g[i] = f[n - i];
	for(i = 0; i <= n; i++) a[i].x = f[i], a[i].y = g[i];
	init(n, n);
	fft(a, 1);
	for(i = 0; i < limit; i++) a[i] = a[i] * a[i];
	fft(a, -1);
	printf("%d ", get0());
	for(i = n - 1; i >= 0; i--){
		printf("%lld ", LL(a[i].y / (2 * limit) + 0.5));
	}
	/*for(i = 0; i < cnt; i++) g[i] = p[cnt - i - 1];
	cnt--;
	for(i = 0; i <= cnt; i++) a[i].x = p[i], a[i].y = g[i];
	init(cnt, cnt);
	fft(a, 1);
	for(i = 0; i < limit; i++) a[i] = a[i] * a[i];
	fft(a, -1);*/

	return 0;
}


#include <bits/stdc++.h>
#define N 800005
using namespace std;
typedef long long LL;
const double pi = acos(-1.0);
struct Complex{
	double x, y;
}a[N];
int s[N], rev[N], f[N], n, limit = 1, len;
Complex operator + (Complex a, Complex b){ return Complex{a.x + b.x, a.y + b.y};}
Complex operator - (Complex a, Complex b){ return Complex{a.x - b.x, a.y - b.y};}
Complex operator * (Complex a, Complex b){ return Complex{a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x};}
int read(){
	int x, f = 1;
	char ch;
	while(ch = getchar(), ch < '0' || ch > '9') if(ch == '-') f = -1;
	x = ch - 48;
	while(ch = getchar(), ch >= '0' && ch <= '9') x = x * 10 + ch - 48;
	return x * f;
}
void fft(Complex *a, int type){
	int i, j, k, mid, R;
	Complex w, Wn;
	for(i = 0; i < limit; i++){
		if(i < rev[i]) swap(a[i], a[rev[i]]);
	}
	for(mid = 1; mid < limit; mid <<= 1){
		Wn = Complex{cos(pi / mid), type * sin(pi / mid)};
		for(R = (mid << 1), j = 0; j < limit; j += R){
			w = Complex{1, 0};
			for(k = 0; k < mid; k++, w = w * Wn){
				Complex x = a[j + k], y = a[j + mid + k] * w;
				a[j + k] = x + y;
				a[j + mid + k] = x - y;
			}
		}
	}
}
void init(int n, int m){
	while(limit <= n + m) limit <<= 1, len++;
	for(int i = 0; i < limit; i++) rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (len - 1));
}
LL get0(){
	int i, p = 0;
	LL ret = 0;
	for(i = 1; i <= n; i++){
		if(s[i] != s[i - 1]) p = i;
		ret += i - p;
	}
	return ret;
}
int main(){
	int i, j, m, x;
	n = read(); x = read();
	f[0]++;
	for(i = 1; i <= n; i++){
		j = read();
		s[i] = s[i - 1] + (j < x);
		f[s[i]]++;
	}
	for(i = 0; i <= n; i++) a[i].x = f[i], a[i].y = f[n - i];
	init(n, n);
	fft(a, 1);
	for(i = 0; i < limit; i++) a[i] = a[i] * a[i];
	fft(a, -1);
	printf("%lld ", get0());
	for(i = n - 1; i >= 0; i--) printf("%lld ", LL(a[i].y / (2 * limit) + 0.5));
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr<<#x<<':'<<x<<" ";
const int maxn = 2e6+10;
typedef complex<double> C;
C wn(int n, int f) {
    return C(cos(acos(-1.0) / n), f*sin((acos(-1.0)) / n));
}
C inv(int n) {
    return C(1.0 / n, 0);
}
C as[maxn], bs[maxn], cs[maxn];
C ar[maxn], br[maxn], cr[maxn];
C ap[maxn], bp[maxn], cp[maxn];
int g[maxn];
void FFT(C *a, int n, int f) {
    for (int i = 0; i < n; i++) if (i > g[i]) swap(a[i], a[g[i]]);
    for (int i = 1; i < n; i <<= 1) {
        C w = wn(i, f), x, y;
        for (int j = 0; j < n; j += i + i) {
            C e;
            e = 1;
            for (int k = 0; k < i; e = e * w, k++) {
                x = a[j + k];
                y = a[j + k + i] * e;
                a[j + k] = x + y;
                a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) {
        C Inv = inv(n);
        for (int i = 0; i < n; i++) a[i] = a[i] * Inv;
    }
}
void conv(C *a, int n, C *b, int m, C *c) {
    int k = 0, s = 2;
    while ((1 << k) < max(n, m) + 1) k++, s <<= 1;
    for (int i = 1; i < s; i++) g[i] = (g[i / 2] / 2) | ((i & 1) << k);
    FFT(a, s, 1);
    FFT(b, s, 1);
    for (int i = 0; i < s; i++) c[i] = a[i] * b[i];
    FFT(c, s, -1);
}

int mx=0;
int init[maxn],s[maxn],aa[maxn];
C a[maxn],b[maxn],res[maxn];

int main()
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        int temp;scanf("%d",&temp);
        if(temp<x) init[i]=1;else init[i]=0;
        s[i]=s[i-1]+init[i];
    }

    aa[0]=1;
    for(int i=1;i<=n;i++)
        aa[s[i]]++;
//    for(int i=1;i<=n;i++)
//        cout<<aa[i]<<' ';
//    cout<<endl;

    for(int i=n;i<=2*n;i++)
        a[i]=1.0*aa[i-n];
    for(int i=0;i<=n;i++)
        b[i]=a[2*n-i];
//    for(int i=0;i<=2*n;i++)
//        cout<<a[i].real()<<' ';
//    cout<<endl;
//    for(int i=0;i<=2*n;i++)
//        cout<<b[i].real()<<' ';
//    cout<<endl;
    conv(a,2*n+1,b,2*n+1,res);
    res[2*n]=0;
    for(int i=0;i<=n;i++)
    {
        double temp;
        temp=1.0*aa[i]*(aa[i]-1)/2;
        res[2*n]+=temp;
    }
    for(int i=2*n;i<=2*n+n;i++)
        printf("%d ",(int)(res[i].real()+0.5));
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr<<#x<<':'<<x<<" ";
const int maxn = 2e6+10;
typedef complex<double> C;
C wn(int n, int f) {
    return C(cos(acos(-1.0) / n), f*sin((acos(-1.0)) / n));
}
C inv(int n) {
    return C(1.0 / n, 0);
}
typedef long long ll;
int g[maxn];
void FFT(C *a, int n, int f) {
    for (int i = 0; i < n; i++) if (i > g[i]) swap(a[i], a[g[i]]);
    for (int i = 1; i < n; i <<= 1) {
        C w = wn(i, f), x, y;
        for (int j = 0; j < n; j += i + i) {
            C e;
            e = 1;
            for (int k = 0; k < i; e = e * w, k++) {
                x = a[j + k];
                y = a[j + k + i] * e;
                a[j + k] = x + y;
                a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) {
        C Inv = inv(n);
        for (int i = 0; i < n; i++) a[i] = a[i] * Inv;
    }
}
void conv(C *a, int n, C *b, int m, C *c) {
    int k = 0, s = 2;
    while ((1 << k) < max(n, m) + 1) k++, s <<= 1;
    for (int i = 1; i < s; i++) g[i] = (g[i / 2] / 2) | ((i & 1) << k);
    FFT(a, s, 1);
    FFT(b, s, 1);
    for (int i = 0; i < s; i++) c[i] = a[i] * b[i];
    FFT(c, s, -1);
}

int mx=0;
int init[maxn],s[maxn],aa[maxn];
C a[maxn],b[maxn],res[maxn];

int main()
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        int temp;scanf("%d",&temp);
        if(temp<x) init[i]=1;else init[i]=0;
        s[i]=s[i-1]+init[i];
    }

    aa[0]=1;
    for(int i=1;i<=n;i++)
        aa[s[i]]++;
//    for(int i=1;i<=n;i++)
//        cout<<aa[i]<<' ';
//    cout<<endl;

    for(int i=n;i<=2*n;i++)
        a[i]=1.0*aa[i-n];
    for(int i=0;i<=n;i++)
        b[i]=a[2*n-i];
//    for(int i=0;i<=2*n;i++)
//        cout<<a[i].real()<<' ';
//    cout<<endl;
//    for(int i=0;i<=2*n;i++)
//        cout<<b[i].real()<<' ';
//    cout<<endl;
    conv(a,2*n+1,b,2*n+1,res);
    res[2*n]=0;
    for(int i=0;i<=n;i++)
    {
        double temp;
        temp=1.0*aa[i]*(aa[i]-1)/2;
        res[2*n]+=temp;
    }
    for(int i=2*n;i<=2*n+n;i++)
        printf("%lld ",(ll)(res[i].real()+0.5));
    cout<<endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define debug(x) cerr<<#x<<':'<<x<<" ";
const int maxn = 8e5+10;
typedef complex<double> C;
C wn(int n, int f) {
    return C(cos(acos(-1.0) / n), f*sin((acos(-1.0)) / n));
}
C inv(int n) {
    return C(1.0 / n, 0);
}

int g[maxn];
void FFT(C *a, int n, int f) {
    for (int i = 0; i < n; i++) if (i > g[i]) swap(a[i], a[g[i]]);
    for (int i = 1; i < n; i <<= 1) {
        C w = wn(i, f), x, y;
        for (int j = 0; j < n; j += i + i) {
            C e;
            e = 1;
            for (int k = 0; k < i; e = e * w, k++) {
                x = a[j + k];
                y = a[j + k + i] * e;
                a[j + k] = x + y;
                a[j + k + i] = x - y;
            }
        }
    }
    if (f == -1) {
        C Inv = inv(n);
        for (int i = 0; i < n; i++) a[i] = a[i] * Inv;
    }
}
void conv(C *a, int n, C *b, int m, C *c) {
    int k = 0, s = 2;
    while ((1 << k) < max(n, m) + 1) k++, s <<= 1;
    for (int i = 1; i < s; i++) g[i] = (g[i / 2] / 2) | ((i & 1) << k);
    FFT(a, s, 1);
    FFT(b, s, 1);
    for (int i = 0; i < s; i++) c[i] = a[i] * b[i];
    FFT(c, s, -1);
}

int mx=0;
int init[maxn],s[maxn],aa[maxn];
C a[maxn],b[maxn],res[maxn];

int main()
{
    int n,x;
    scanf("%d%d",&n,&x);
    for(int i=1;i<=n;i++)
    {
        int temp;scanf("%d",&temp);
        if(temp<x) init[i]=1;else init[i]=0;
        s[i]=s[i-1]+init[i];
    }

    aa[0]=1;
    for(int i=1;i<=n;i++)
        aa[s[i]]++;
//    for(int i=1;i<=n;i++)
//        cout<<aa[i]<<' ';
//    cout<<endl;

    for(int i=n;i<=2*n;i++)
        a[i]=1.0*aa[i-n];
    for(int i=0;i<=n;i++)
        b[i]=a[2*n-i];
//    for(int i=0;i<=2*n;i++)
//        cout<<a[i].real()<<' ';
//    cout<<endl;
//    for(int i=0;i<=2*n;i++)
//        cout<<b[i].real()<<' ';
//    cout<<endl;
    conv(a,2*n+1,b,2*n+1,res);
    res[2*n]=0;
    for(int i=0;i<=n;i++)
    {
        double temp;
        temp=1.0*aa[i]*(aa[i]-1)/2;
        res[2*n]+=temp;
    }
    for(int i=2*n;i<=2*n+n;i++)
        printf("%d ",(int)(res[i].real()+0.5));
    cout<<endl;
    return 0;
}