#include <bits/stdc++.h>
const double pi = 3.141592653589793238462643383279502884197;
inline int readInt() {
  int ans = 0, c, f = 1;
  while (!isdigit(c = getchar()))
    if (c == '-') f *= -1;
  do ans = ans * 10 + c - '0';
  while (isdigit(c = getchar()));
  return ans * f;
}
void FFT(std::complex<double> *A, int len, int opt) {
  for (int i = 1, j = 0; i < len; ++i) {
    for (int k = len; ~j & k; j ^= k >>= 1)
      ;
    if (i < j) std::swap(A[i], A[j]);
  }
  for (int h = 2; h <= len; h <<= 1) {
    std::complex<double> wn =
        std::complex<double>(cos(opt * 2 * pi / h), sin(opt * 2 * pi / h));
    for (int j = 0; j < len; j += h) {
      std::complex<double> w = 1.0;
      for (int i = 0; i < (h >> 1); ++i) {
        std::complex<double> _t1 = A[j + i], _t2 = A[j + i + (h >> 1)] * w;
        A[j + i] = _t1 + _t2;
        A[j + i + (h >> 1)] = _t1 - _t2;
        w *= wn;
      }
    }
  }
  if (opt == -1)
    for (int i = 0; i < len; ++i) A[i] /= len;
}
const int N = 1000000;
int n, x;
std::complex<double> F[N], G[N];
long long Ans[N];
int main() {
  n = readInt(), x = readInt();
  int S = 0;
  F[0] = 1.0;
  for (int i = 0; i < n; ++i) F[S += readInt() < x] += 1.0;
  for (int i = 0; i <= n; ++i) G[n - i] = F[i];
  int len = 1;
  while (len <= n * 2) len <<= 1;
  FFT(F, len, 1);
  FFT(G, len, 1);
  for (int i = 0; i < len; ++i) F[i] *= G[i];
  FFT(F, len, -1);
  long long ans = n;
  ans = ans * (n + 1) / 2;
  for (int i = 1; i <= n; ++i) ans -= Ans[i] = F[n + i].real() + 0.1;
  printf("%I64d\n", ans);
  for (int i = 1; i <= n; ++i) printf("%I64d\n", Ans[i]);
}
