#include <bits/stdc++.h>
using namespace std;
namespace red {
inline long long read() {
  long long x = 0;
  char ch, f = 1;
  for (ch = getchar(); (ch < '0' || ch > '9') && ch != '-'; ch = getchar())
    ;
  if (ch == '-') f = 0, ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = (x << 1) + (x << 3) + ch - '0';
    ch = getchar();
  }
  return f ? x : -x;
}
const long long N = 1e6 + 10;
double pi = acos(-1.0);
long long n, tmp, limit, len;
long long a[N], pos[N], ret[N];
struct complex {
  double x, y;
  complex(double tx = 0, double ty = 0) { x = tx, y = ty; }
  inline complex operator+(const complex &t) const {
    return complex(x + t.x, y + t.y);
  }
  inline complex operator-(const complex &t) const {
    return complex(x - t.x, y - t.y);
  }
  inline complex operator*(const complex &t) const {
    return complex(x * t.x - y * t.y, x * t.y + y * t.x);
  }
} f[N], g[N];
inline void fft(long long limit, complex *a, long long inv) {
  for (long long i = 0; i < limit; ++i)
    if (i < pos[i]) swap(a[i], a[pos[i]]);
  for (long long mid = 1; mid < limit; mid <<= 1) {
    complex Wn(cos(pi / mid), inv * sin(pi / mid));
    for (long long r = mid << 1, j = 0; j < limit; j += r) {
      complex w(1, 0);
      for (long long k = 0; k < mid; ++k, w = w * Wn) {
        complex x = a[j + k], y = w * a[j + k + mid];
        a[j + k] = x + y;
        a[j + k + mid] = x - y;
      }
    }
  }
}
inline void main() {
  n = read(), tmp = read();
  for (long long i = 1; i <= n; ++i) a[i] = (read() < tmp);
  f[0].x = 1;
  for (long long tmp = 0, i = 1; i <= n; ++i) {
    tmp += a[i];
    ++f[tmp].x;
  }
  for (long long i = 1; i <= n; ++i) g[i].x = f[n - i].x;
  for (limit = 1; limit <= n + n; limit <<= 1) ++len;
  for (long long i = 0; i < limit; ++i)
    pos[i] = (pos[i >> 1] >> 1) | ((i & 1) << (len - 1));
  fft(limit, f, 1);
  fft(limit, g, 1);
  for (long long i = 0; i < limit; ++i) f[i] = f[i] * g[i];
  fft(limit, f, -1);
  for (long long tmp = 0, sum = 0, i = 1; i <= n; ++i) {
    if (!a[i])
      ++sum;
    else {
      tmp += ((sum + 1) * sum) >> 1;
      sum = 0;
    }
    if (i == n) {
      tmp += ((sum + 1) * sum) >> 1;
      printf("%lld ", tmp);
    }
  }
  for (long long i = n + 1; i <= n + n; ++i) ret[i] = f[i].x / limit + 0.5;
  for (long long i = n + 1; i <= n + n; ++i) printf("%lld ", ret[i]);
}
}  // namespace red
signed main() {
  red::main();
  return 0;
}
