#include <bits/stdc++.h>
using namespace std;
struct cd {
  double x, y;
  cd(double _x = 0, double _y = 0) : x(_x), y(_y){};
  cd operator+(const cd &d) const { return (cd){x + d.x, y + d.y}; }
  cd operator-(const cd &d) const { return (cd){x - d.x, y - d.y}; }
  cd operator*(const cd &d) const {
    return (cd){x * d.x - y * d.y, x * d.y + y * d.x};
  }
  cd operator/(const double &d) const { return (cd){x / d, y / d}; }
};
using ll = long long;
const double PI = acos(-1);
cd binPow(cd a, long long q) {
  cd ret = 1;
  while (q) {
    if (q & 1LL) ret = ret * a;
    a = a * a;
    q >>= 1LL;
  }
  return ret;
}
struct FFT {
 public:
  FFT() {}
  void fft(vector<cd> &a, bool invert) {
    long long n = a.size();
    for (long long i = 1, j = 0; i < n; i++) {
      long long bit = n >> 1;
      for (; j & bit; bit >>= 1) j ^= bit;
      j ^= bit;
      if (i < j) swap(a[i], a[j]);
    }
    for (long long len = 2; len <= n; len <<= 1) {
      double ang = 2 * PI / len * (invert ? -1 : 1);
      cd wlen(cos(ang), sin(ang));
      for (long long i = 0; i < n; i += len) {
        cd w(1);
        for (long long j = 0; j < len / 2; j++) {
          cd u = a[i + j], v = a[i + j + len / 2] * w;
          a[i + j] = u + v;
          a[i + j + len / 2] = u - v;
          w = w * wlen;
        }
      }
    }
    if (invert) {
      for (auto &x : a) x = x / n;
    }
  }
  long long f2(long long x) {
    if (__builtin_popcountll(x) != 1)
      return 1LL << ((63 - __builtin_clzll(x)) + 1);
    return x;
  }
  vector<ll> multiply(vector<long long> const &a, vector<long long> const &b) {
    vector<cd> fa(a.begin(), a.end()), fb(b.begin(), b.end());
    long long rlen = a.size() + b.size() - 1;
    long long len = f2(rlen);
    fa.resize(len);
    fb.resize(len);
    fft(fa, false);
    fft(fb, false);
    for (long long i = (long long)0; i <= (long long)len - 1; i++)
      fa[i] = fa[i] * fb[i];
    fft(fa, true);
    vector<ll> result(rlen);
    for (long long i = (long long)0; i <= (long long)rlen - 1; i++)
      result[i] = round(fa[i].x);
    return result;
  }
  vector<ll> power(const vector<long long> &a, long long q) {
    long long len = f2(q * a.size());
    vector<cd> fa(a.begin(), a.end());
    fa.resize(len, 0);
    fft(fa, false);
    for (auto &it : fa) it = binPow(it, q);
    fft(fa, true);
    vector<ll> ret(fa.size());
    for (long long i = (long long)0; i <= (long long)fa.size() - 1; i++)
      ret[i] = round(fa[i].x);
    return ret;
  }
} fft;
long long n, piv;
vector<long long> pref;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n >> piv;
  pref.push_back(0);
  for (long long i = (long long)1; i <= (long long)n; i++) {
    long long t;
    cin >> t;
    pref.push_back(pref.back() + (t < piv));
  }
  vector<long long> a(n + 1, 0);
  for (auto it : pref) a[it]++;
  vector<long long> b = a;
  reverse(b.begin(), b.end());
  auto rec = fft.multiply(a, b);
  rec[n] = 0;
  for (auto it : a) rec[n] += it * (it - 1) / 2;
  for (long long i = (long long)n; i <= (long long)rec.size() - 1; i++)
    cout << rec[i] << ' ';
  cout << '\n';
}
