#include <bits/stdc++.h>
const long double Pi = std::acos(-1.0);
const int maxl = 1024 * 512;
struct Complex {
  long double x, y;
  Complex() {}
  Complex(long double x0, long double y0) {
    x = x0;
    y = y0;
  }
  Complex operator+(const Complex &a) const {
    return Complex(x + a.x, y + a.y);
  }
  Complex operator-(const Complex &a) const {
    return Complex(x - a.x, y - a.y);
  }
  Complex operator*(const Complex &a) const {
    return Complex(x * a.x - y * a.y, x * a.y + y * a.x);
  }
  Complex operator/(int a) const { return Complex(x / a, y / a); }
};
struct MUL {
  int lim, len, mp[maxl];
  Complex X[maxl];
  void init(int l) {
    lim = 1;
    len = -1;
    while (lim <= l) {
      lim <<= 1;
      ++len;
    }
    for (int i = 1; i < lim; ++i) mp[i] = (mp[i >> 1] >> 1) | ((i & 1) << len);
  }
  void fft(Complex S[maxl], int op) {
    for (int i = 1; i < lim; ++i)
      if (i < mp[i]) {
        Complex t = S[i];
        S[i] = S[mp[i]];
        S[mp[i]] = t;
      }
    for (int i = 1; i < lim; i <<= 1) {
      Complex wn(std::cos(Pi / i), std::sin(Pi / i) * op);
      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 = S[j + k], y = S[i + j + k] * w;
          S[j + k] = x + y;
          S[i + j + k] = x - y;
        }
      }
    }
    if (op < 0)
      for (int i = 0; i < lim; ++i) S[i] = S[i] / lim;
  }
  void operator()(int n, int m, long long S[maxl], long long T[maxl],
                  long long R[maxl]) {
    init(n + m);
    for (int i = 0; i <= n; ++i) X[i].x = S[i];
    for (int i = n + 1; i < lim; ++i) X[i].x = 0;
    for (int i = 0; i <= m; ++i) X[i].y = T[i];
    for (int i = m + 1; i < lim; ++i) X[i].y = 0;
    fft(X, 1);
    for (int i = 0; i < lim; ++i) X[i] = X[i] * X[i];
    fft(X, -1);
    for (int i = 0; i <= n + m; ++i) R[i] = std::round(X[i].y / 2);
    for (int i = n + m + 1; i < lim; ++i) R[i] = 0;
  }
} mul;
int a[maxl];
long long A[maxl], B[maxl];
int main() {
  int n, m;
  long long ans = 0;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", a + i);
    if (a[i] < m)
      a[i] = 1;
    else
      a[i] = 0;
  }
  for (int i = 1; i <= n; ++i) {
    a[i] += a[i - 1];
    ++A[a[i]];
  }
  for (int i = 0; i < n; ++i) {
    ++B[n - a[i]];
  }
  for (int i = 1, j = 1; i <= n; i = j) {
    while (j <= n && a[i] == a[j]) ++j;
    if (a[i])
      ans += (long long)(j - i) * (j - i - 1) / 2;
    else
      ans += (long long)(j - i) * (j - i + 1) / 2;
  }
  printf("%lld ", ans);
  mul(n, n, A, B, A);
  for (int i = 1; i <= n; ++i) printf("%lld ", A[n + i]);
  printf("\n");
  return 0;
}
