#include <bits/stdc++.h>   using namespace std;   const double PI = acos(-1);   void fft(vector<complex<double> >& a, bool invert) {     int n = (int)a.size();     for (int i = 1, j = 0; i < n; ++i) {       int bit = n >> 1;       for (; j >= bit; bit >>= 1) j -= bit;       j += bit;       if (i < j) swap(a[i], a[j]);     }     for (int len = 2; len <= n; len <<= 1) {       double ang = 2 * PI / len * (invert ? -1 : 1);       complex<double> wlen(cos(ang), sin(ang));       for (int i = 0; i < n; i += len) {         complex<double> w(1);         for (int j = 0; j < len / 2; ++j) {           complex<double> u = a[i + j], v = a[i + j + len / 2] * w;           a[i + j] = u + v;           a[i + j + len / 2] = u - v;           w *= wlen;         }       }     }     if (invert)       for (int i = 0; i < n; ++i) a[i] /= n;   }   void multiply(const vector<long long int>& a, const vector<long long int>& b,                 vector<long long int>& res) {     vector<complex<double> > fa(a.begin(), a.end()), fb(b.begin(), b.end());     size_t n = 1;     while (n < max(a.size(), b.size())) n <<= 1;     n <<= 1;     fa.resize(n), fb.resize(n);     fft(fa, false), fft(fb, false);     for (size_t i = 0; i < n; ++i) fa[i] *= fb[i];     fft(fa, true);     res.resize(n);     for (size_t i = 0; i < n; ++i) res[i] = (long long int)(fa[i].real() + 0.5);   }   vector<long long int> now(1, 1);   int main() {     vector<long long int> res;     int n, x;     cin >> n >> x;     int need = n;     while (n--) {       int u;       cin >> u;       if (u < x) {         now.push_back(1);       } else {         ++now.back();       }     }     long long int w0 = 0;     for (auto e : now) {       w0 += e * (e - 1) / 2;     }     int k = now.size();     vector<long long int> nowr(now.rbegin(), now.rend());     nowr.back() = 0;     multiply(now, nowr, res);     cout << w0 <<    ;     for (int i = k - 2; i >= 0 && res[i]; i--) {       cout << res[i] <<    ;       --need;     }     while (need--) {       cout << 0 <<    ;     }     return 0;   }   