#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int, int>;
using vll = vector<ll>;
namespace FFT {
using ld = double;
using T = complex<ld>;
const ld PI = acosl(-1.0);
const int MAXB = 21;
const int MAXN = 1 << MAXB;
int rev[MAXN];
T roots[MAXN];
bool was_precalc{false};
void precalc() {
  if (was_precalc) {
    return;
  }
  was_precalc = 1;
  roots[0] = 1;
  int j = -1;
  for (int i = 1; i < MAXN; ++i) {
    if ((i & (i - 1)) == 0) {
      ld ang = 2 * PI / MAXN * i;
      roots[i] = T(cos(ang), sin(ang));
      ++j;
    } else {
      roots[i] = roots[1 << j] * roots[i ^ (1 << j)];
    }
  }
}
T get_root(int k, int n) { return roots[k * (MAXN / n)]; }
void fft(T* a, int K, bool inv) {
  precalc();
  const int n = 1 << K;
  rev[0] = 0;
  for (int i = 1; i < n; ++i) {
    rev[i] = (rev[i >> 1] >> 1) ^ ((i & 1) << (K - 1));
  }
  for (int i = 0; i < int(n); ++i) {
    if (i < rev[i]) {
      swap(a[i], a[rev[i]]);
    }
  }
  for (int len = 1; len < n; len *= 2) {
    vector<T> rs(len);
    for (int i = 0; i < int(len); ++i) {
      rs[i] = get_root(i, len * 2);
    }
    for (int i = 0; i < n; i += len * 2) {
      for (int j = 0; j < int(len); ++j) {
        const auto& w = rs[j];
        const auto x = a[i + j];
        const auto y = a[i + len + j];
        a[i + j] = x + w * y;
        a[i + len + j] = x - w * y;
        if (inv) {
          a[i + j] /= 2;
          a[i + len + j] /= 2;
        }
      }
    }
  }
  if (inv) {
    reverse(a + 1, a + n);
  }
}
vll mult(const vi& a, const vi& b) {
  int K = 0;
  while ((1 << K) < max(int((a).size()), int((b).size()))) {
    ++K;
  }
  ++K;
  vector<T> A(1 << K);
  vector<T> B(1 << K);
  for (int i = 0; i < int(int((a).size())); ++i) {
    A[i] = a[i];
  }
  for (int i = 0; i < int(int((b).size())); ++i) {
    B[i] = b[i];
  }
  fft(A.data(), K, false);
  fft(B.data(), K, false);
  for (int i = 0; i < int(int((A).size())); ++i) {
    A[i] *= B[i];
  }
  fft(A.data(), K, true);
  vll res(int((A).size()));
  for (int i = 0; i < int(int((A).size())); ++i) {
    res[i] = round(A[i].real());
  }
  return res;
}
vll brut_mult(const vi& a, const vi& b) {
  vll c(int((a).size()) + int((b).size()));
  for (int i = 0; i < int(int((a).size())); ++i) {
    for (int j = 0; j < int(int((b).size())); ++j) {
      c[i + j] += a[i] * b[j];
    }
  }
  return c;
}
};  // namespace FFT
double cur_time() { return clock() * 1.0 / CLOCKS_PER_SEC; }
int n, x;
vi a;
bool read() {
  if (!(cin >> n >> x)) {
    return 0;
  }
  a.resize(n);
  for (int i = 0; i < int(n); ++i) {
    cin >> a[i];
    if (a[i] < x) {
      a[i] = 1;
    } else {
      a[i] = 0;
    }
  }
  return 1;
}
void solve() {
  vi pref(n + 1, 0);
  for (int i = 0; i < int(n); ++i) {
    pref[i + 1] = pref[i] + a[i];
  }
  vi cnt(n + 1, 0);
  for (int v : pref) {
    ++cnt[v];
  }
  vi cnt_rev = cnt;
  reverse((cnt_rev).begin(), (cnt_rev).end());
  vll mul = FFT::mult(cnt, cnt_rev);
  vll ans(n + 1);
  for (int k = 0; k < int(n + 1); ++k) {
    ans[k] = mul[n + k];
  }
  ll ans0 = 0;
  for (int i = 0, j = 0; i < int((pref).size()); i = j) {
    while (j < int((pref).size()) && pref[i] == pref[j]) {
      ++j;
    }
    int len = j - i;
    ans0 += len * 1ll * (len - 1) / 2;
  }
  ans[0] = ans0;
  for (int k = 0; k < int(int((ans).size())); ++k) {
    cout << ans[k] << " ";
  }
  cout << endl;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  while (read()) {
    solve();
  }
}
