#include <bits/stdc++.h>
using namespace std;
long long read() {
  char ch = getchar();
  long long x = 0;
  int op = 1;
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') op = -1;
  for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + ch - '0';
  return x * op;
}
const double pi = acos(-1);
int n1, n, m, sum, r[600005], last;
long long ans;
struct cp {
  double a, b;
  cp() { a = 0, b = 0; }
  cp(double a_, double b_) { a = a_, b = b_; }
  cp operator+(cp t) { return cp(a + t.a, b + t.b); }
  cp operator-(cp t) { return cp(a - t.a, b - t.b); }
  cp operator*(cp t) { return cp(a * t.a - b * t.b, a * t.b + b * t.a); }
} a[600005], b[600005], w[600005];
void init(int n) {
  w[n] = cp(1, 0);
  for (int i = (0); i <= (n - 1); i++) {
    w[i] = cp(cos(2 * i * pi / n), sin(2 * i * pi / n));
    r[i] = (r[i >> 1] >> 1) | ((i & 1) * (n >> 1));
  }
}
void fft(cp a[], int ALL, int fl) {
  for (int i = (0); i <= (ALL - 1); i++)
    if (i < r[i]) swap(a[i], a[r[i]]);
  int n = 2, m = 1, x = ALL / 2;
  for (; n <= ALL; m = n, n <<= 1, x >>= 1)
    for (int i = 0; i < ALL; i += n)
      for (int k = 0; k < m; k++) {
        cp t = (fl ? w[ALL - x * k] : w[x * k]) * a[i + m + k];
        a[i + m + k] = a[i + k] - t;
        a[i + k] = a[i + k] + t;
      }
  if (fl)
    for (int i = (0); i <= (ALL - 1); i++) a[i].a /= ALL;
}
int main() {
  n1 = read();
  m = read();
  sum = 0;
  last = -1;
  for (int i = (0); i <= (n1 - 1); i++) {
    a[sum].a++;
    int x = read() < m;
    sum += x;
    b[sum].a++;
    if (x) last = i;
    ans += i - last;
  }
  cout << ans;
  reverse(&a[0], &a[sum + 1]);
  n = 1;
  for (; n <= 2 * sum; n <<= 1)
    ;
  init(n);
  fft(a, n, 0);
  fft(b, n, 0);
  for (int i = (0); i <= (n - 1); i++) a[i] = a[i] * b[i];
  fft(a, n, 1);
  for (int i = (1); i <= (n1); i++)
    cout << ' ' << (long long)(a[sum + i].a + 0.5);
  return 0;
}
