#include <iostream>
#include <cstdio>
#include <cstring>
#include <stack>
#include <cmath>
#define ll long long
using namespace std;
const int maxn=1e5+19;
int n;
int a[maxn];
int l[maxn];///右边第一个比它大的数的位置
int r[maxn];///左边第一个比它大的数的位置
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>a[i];
	stack<int> s;
	stack<int> s2;
	for(int i=n;i>=1;i--)
	{
		while(s.size()&&a[s.top()]<a[i])
			s.pop();
		if(s.empty())
			l[i]=n+1;
		else
			l[i]=s.top();
		s.push(i);
	}

	for(int i=1;i<=n;i++)
	{
		while(s2.size()&&a[s2.top()]<a[i])
			s2.pop();
		if(s2.empty())
			r[i]=0;
		else
			r[i]=s2.top();
		s2.push(i);
	}
	int maxx=-1;
	for(int i=1;i<=n;i++)
	{
        //左右端点特判
		if(l[i]!=n+1)
			maxx=max(maxx,a[i]^a[l[i]]);
		if(r[i]!=0)
			maxx=max(maxx,a[i]^a[r[i]]);
	}
	cout<<maxx<<endl;
}


#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
int q[100005];
int num[100005];
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&num[i]);
    int r=1;
    q[1]=1;
    int ans=0;
    for(int i=2;i<=n;i++)
    {
        while(r>0&&num[q[r]]<num[i])
            r--;
        q[++r]=i;
        if(r>1)
            ans=max(ans,num[q[r]]^num[q[r-1]]);
    }
    q[1]=n;
    for(int i=n-1;i>0;i++)
    {
        while(r>0&&num[q[r]]<num[i])
            r--;
        q[++r]=i;
        if(r>1)
            ans=max(ans,num[q[r]]^num[q[r-1]]);
    }
    printf("%d\n",ans);
}


#include <stdio.h>
#include <string.h>
#include <algorithm>

using namespace std;

const int N = 1e5 + 5;

int n,a[N],s[N];

int solve()
{
    int ret = 0 , top = 0;
    for(int i=0;i<n;i++)
    {
        while(top && a[s[top]] < a[i])
            --top;
        if(top)
            ret = max(ret,a[s[top]] ^ a[i]);
        s[++top] = i;
    }
    return ret;
}

int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%d",&a[i]);
    int ans = solve();
    reverse(a,a+n);
    ans = max(ans,solve());
    printf("%d\n",ans);
    return 0;
}


#include <bits/stdc++.h>

#define loop(i,n)    for( int i=0; i<n; i++ )
#define loop1(i,a,n) for( int i=a; i<n; i++ )
#define vloop(i,a)   for( vector<int>::iterator i=a.begin(); i!=a.end(); i++ )
#define dloop(i,a)   for( deque<int>::iterator i=a.begin(); i!=a.end(); i++ )
#define PI 3.14159265
#define bc __builtin_popcountl
#define gc getchar_unlocked
#define pc putchar_unlocked
#define pb push_back
#define pf push_front
#define rf pop_front
#define rb pop_back
#define mp make_pair
#define fs first
#define sc second
#define fi ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll M = 1e9+7;
const ll INF = 1e9;

inline ll pwr(ll base,ll n,ll m){ll ans=1;while(n>0){if(n%2==1)ans=(ans*base)%m;base=(base*base)%m;n/=2;}return ans;}

const int sz = (int)1e5 + 1;
int a[sz], lmax[sz], rmax[sz], n;

void solve() {

    stack<int>s;
    s.push(a[0]);
    loop1(i,1,n) {
        while( !s.empty() && s.top() < a[i] )
            s.pop();
        if( !s.empty() )
            lmax[i] = s.top();
        else
            lmax[i] = a[i];
        s.push(a[i]);
    }

    while( !s.empty() )
        s.pop();

    for( int i = n-2; i>=0; i-- ) {
        while( !s.empty() && s.top() < a[i] )
            s.pop();
        if( !s.empty() )
            rmax[i] = s.top();
        else
            rmax[i] = a[i];
        s.push(a[i]);
    }
    //loop(i,n)cout<<lmax[i]<<" ";cout<<"\n";
    //loop(i,n)cout<<rmax[i]<<" ";cout<<"\n";

}

int main() {
    fi;

    cin>>n;

    loop(i,n)
        cin>>a[i];
    solve();

    int mx = 0;

    loop(i,n) {
        if( i > 0 )
        mx = max(mx, a[i] ^ lmax[i] );
        if( i < n-1 )
        mx = max(mx, a[i] ^ rmax[i] );
    }
    cout<<mx;
    return 0;
}


#include <bits/stdc++.h>

#define loop(i,n)    for( int i=0; i<n; i++ )
#define loop1(i,a,n) for( int i=a; i<n; i++ )
#define vloop(i,a)   for( vector<int>::iterator i=a.begin(); i!=a.end(); i++ )
#define dloop(i,a)   for( deque<int>::iterator i=a.begin(); i!=a.end(); i++ )
#define PI 3.14159265
#define bc __builtin_popcountl
#define gc getchar_unlocked
#define pc putchar_unlocked
#define pb push_back
#define pf push_front
#define rf pop_front
#define rb pop_back
#define mp make_pair
#define fs first
#define sc second
#define fi ios_base::sync_with_stdio(false); cin.tie(NULL)

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll M = 1e9+7;
const ll INF = 1e9;

inline ll pwr(ll base,ll n,ll m){ll ans=1;while(n>0){if(n%2==1)ans=(ans*base)%m;base=(base*base)%m;n/=2;}return ans;}

const int sz = (int)1e5 + 1;
int a[sz], lmax[sz], rmax[sz], n;

void solve() {

    stack<int>s;
    s.push(a[0]);

    lmax[0] = a[0];

    loop1(i,1,n) {
        while( !s.empty() && s.top() < a[i] )
            s.pop();
        if( !s.empty() )
            lmax[i] = s.top();
        else
            lmax[i] = a[i];
        s.push(a[i]);
    }

    while( !s.empty() )
        s.pop();
    rmax[n-1] = a[n-1];
    s.push(a[n-1]);
    for( int i = n-2; i>=0; i-- ) {
        while( !s.empty() && s.top() < a[i] )
            s.pop();
        if( !s.empty() )
            rmax[i] = s.top();
        else
            rmax[i] = a[i];
        s.push(a[i]);
    }
    //loop(i,n)cout<<lmax[i]<<" ";cout<<"\n";
    //loop(i,n)cout<<rmax[i]<<" ";cout<<"\n";

}

int main() {
    fi;

    cin>>n;

    loop(i,n)
        cin>>a[i];
    solve();

    int mx = 0;

    loop(i,n)
        mx = max(mx, max( a[i] ^ lmax[i], a[i] ^ rmax[i] )  );

    cout<<mx<<"\n";
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y,a[1000010],maxx;
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;++i){
        scanf("%d",&x);
        while (y and a[y]<x)
            maxx=max(maxx,x^a[y--]);
        if (y)
            maxx=max(maxx,x^a[y]);
        a[++y]=x;
    }
    printf("%d\n",maxx);
}


#include<bits/stdc++.h>
using namespace std;
int n,x,y,a[1000010],maxx;
int main(){
    scanf("%d",&n);
    for (int i=1;i<=n;++i){
        scanf("%d",&x);
        while (y and a[y]<x)
            maxx=max(m,x^a[y--]);
        if (y)
            maxx=max(m,x^a[y]);
        a[++y]=x;
    }
    printf("%d\n",maxx);
}


#include <iostream>
#include <vector>

using namespace std;

int findLucky(const vector<int>& numbers) {
    int maxLucky = 0;
    // keep a stack of open problems, and discard solutions that we will not possibly need
    vector<int> s;

    s.push_back(numbers[0]);
    for (int i = 1; i < numbers.size(); ++i) {
        for (int sp = s.size() - 1; sp >= 0; --sp) {
            maxLucky = max(maxLucky, numbers[i] ^ numbers[sp]);

            // numbers are guaranteed to be distinct so the equality never holds
            if (numbers[sp] < numbers[i]) {
                s.pop_back();
            }
        }

        s.push_back(numbers[i]);
    }

    return maxLucky;
}

int main() {
    int n;
    cin >> n;
    vector<int> numbers(n);
    for (int i = 0; i < n; ++i) {
        cin >> numbers[i];
    }

    cout << findLucky(numbers) << endl;
}


#include <iostream>
#include <vector>
#include <stack>

using namespace std;

int findLucky(const vector<int>& numbers) {
    int maxLucky = 0;
    // keep a stack of open problems, and discard solutions that we will not possibly need
    stack<int> s;

    s.push(numbers[0]);
    for (int i = 1; i < numbers.size(); ++i) {
        while (!s.empty()) {
            maxLucky = max(maxLucky, numbers[i] ^ s.top());

            // numbers are guaranteed to be distinct so the equality never holds
            if (s.top() < numbers[i]) {
                s.pop();
            } else {
                break;
            }
        }

        s.push(numbers[i]);
    }

    return maxLucky;
}

int main() {
    int n;
    cin >> n;
    vector<int> numbers(n);
    for (int i = 0; i < n; ++i) {
        cin >> numbers[i];
    }

    cout << findLucky(numbers) << endl;
}


#include <stdio.h>
#include <iostream>
#include <climits>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <utility>
#include <queue>

using namespace std;

#define ll long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <long long, long long>
#define pb push_back

ll ar[300000];

deque <ll> dq;

int main ()
{
  //  freopen("inl.txt", "r", stdin);
   // freopen("outu.txt", "w", stdout);
  //  ios_base::sync_with_stdio(0); // no printf/scanf must be present
    ll cs, t, i, j, k, x, y, z, ans, q, m, n;

    sl(n);

    for (cs = 0; cs < n; cs++)
    {
        sl(ar[cs]);
    }

    dq.pb(ar[0]);

    ans = ar[0]^ar[1];

    for (i = 1; i < n; i++)
    {
        for (j = dq.size() - 1; j >= 0; j--)
        {
            if (dq[j] > ar[i])
            {
                ans = max(ans, dq[j]^ar[i]);
                break;
            }
            else
            {
                ans = max(ans, dq[j]^ar[i]);
                dq.pop_back();
            }
        }
    }

    cout << ans << endl;

    return 0;
}


#include <stdio.h>
#include <iostream>
#include <climits>
#include <map>
#include <cmath>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <vector>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <utility>
#include <queue>

using namespace std;

#define ll long long
#define sl(n) scanf("%lld", &n)
#define sf(n) scanf("%lf", &n)
#define si(n) scanf("%d", &n)
#define ss(n) scanf("%s", n)
#define pii pair <int, int>
#define pll pair <long long, long long>
#define pb push_back

ll ar[300000];

deque <ll> dq;

int main ()
{
  //  freopen("inl.txt", "r", stdin);
   // freopen("outu.txt", "w", stdout);
  //  ios_base::sync_with_stdio(0); // no printf/scanf must be present
    ll cs, t, i, j, k, x, y, z, ans, q, m, n;

    sl(n);

    for (cs = 0; cs < n; cs++)
    {
        sl(ar[cs]);
    }

    dq.pb(ar[0]);

    ans = ar[0]^ar[1];

    for (i = 1; i < n; i++)
    {
        for (j = dq.size() - 1; j >= 0; j--)
        {
//            cout << i << " " << j << " " << dq[j] << " " << ar[i] << " " << ans << endl;
            if (dq[j] > ar[i])
            {
                ans = max(ans, dq[j]^ar[i]);
                break;
            }
            else
            {
                ans = max(ans, dq[j]^ar[i]);
                dq.pop_back();
            }
        }
        dq.pb(ar[i]);
  //      cout << i << " " << ans << endl;
    }

    cout << ans << endl;

    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int Maxn = 5e4+7;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;

int read(){
	int x=0,f=1;
	char s=getchar();
	while(s<'0'||s>'9'){
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9'){
		x=x*10+s-'0';
		s=getchar();
	}
	return x*f;
}

int n,x;

int st;
int stk[Maxn];

int ans;

int main(){
	n=read();
	for(int i=1;i<=n;i++){
		x=read();
		while(st>=1){
			ans=max(ans,stk[st]^x);
			if(stk[st]>x)
				break;
			st--;
		}
		stk[++st]=x;
	}
	cout<<ans<<endl;
}


#include <iostream>
#include <cstdio>
#include <algorithm>
#include <set>
#define N 100050
using namespace std;
typedef long long ll;
const int p = (int)1e9 + 7;
struct node {
    ll l, r;
    bool operator < (const node &b) const {
        if (l == b.l) return r < b.r;
        else return l < b.l;
    }
} a[N];
int main() {
    multiset<ll> s;
    ll n, x, y;
    scanf("%lld%lld%lld", &n, &x, &y);
    for (int i = 1; i <= n; i++) {
        scanf("%lld%lld", &a[i].l, &a[i].r);
    }
    sort (a + 1, a + n + 1);
    s.insert(a[1].r);
    multiset<ll>::iterator it;
    ll ans = (x + y * (a[1].r - a[1].l) % p) % p;
    for (int i = 2; i <= n; i++) {
//    	cout<<a[i].l<<endl;
        it = s.lower_bound(a[i].l);
        cout<<i<<" "<<a[i].l<<" "<<*it<<endl;
        if (it == s.begin()) {
            ans = (ans + x + y * (a[i].r - a[i].l) % p) % p;
            s.insert(a[i].r);
            cout<<i<<" "<<ans<<endl;
        }
        else {
            it--;
            while (a[i].l == *it && it != s.begin()) {
                it--;
            }
//            cout<<*it<<endl;
            if (*it == a[i].l) {
                ans = (ans + x + y * (a[i].r - a[i].l) % p) % p;
            }
            else {
                if ((a[i].l - *it) * y < x) {
                    ans = (ans + (a[i].r - *it) * y % p) % p;
                    s.erase(it);
                }
                else {
                    ans = (ans + x + (a[i].r - a[i].l) * y % p) % p;
                }
            }
            s.insert(a[i].r);
        }
//       cout<<ans<<endl;
    }
    cout << ans % p << endl;
    return 0;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int Maxn = 5e5+7;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;

int read(){
	int x=0,f=1;
	char s=getchar();
	while(s<'0'||s>'9'){
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9'){
		x=x*10+s-'0';
		s=getchar();
	}
	return x*f;
}

int n,x;

int st;
int stk[Maxn];

int ans;

int main(){
	n=read();
	for(int i=1;i<=n;i++){
		x=read();
		while(st>=1){
			ans=max(ans,stk[st]^x);
			if(stk[st]>x)
				break;
			st--;
		}
		stk[++st]=x;
	}
	cout<<ans<<endl;
}


#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>

using namespace std;
typedef long long ll;
const int Maxn = 5e4+7;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;

int read(){
	int x=0,f=1;
	char s=getchar();
	while(s<'0'||s>'9'){
		if(s=='-')
			f=-1;
		s=getchar();
	}
	while(s>='0'&&s<='9'){
		x=x*10+s-'0';
		s=getchar();
	}
	return x*f;
}

int n,x;

int st;
int stk[Maxn];

int ans;

int main(){
	n=read();
	for(int i=1;i<=n;i++){
		x=read();
		while(st>0){
			ans=max(ans,stk[st]^x);
			if(stk[st]>x)
				break;
			st--;
		}
		stk[++st]=x;
	}
	cout<<ans<<endl;
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
	static double ans;
	static List<List<Integer>> E = new ArrayList<List<Integer>>();
	static int[] P;
	static void root(int v, int depth) {
		ans += 1.0/depth;
		for(Integer w:E.get(v)) {
			if(w == P[v]) continue;
			P[w] = v;
			root(w, depth+1);
		}
	}

	static int i(String S) { return Integer.parseInt(S); }
	public static void main(String[] args) throws Exception {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int n = i(in.readLine());
		for(int i=0; i<n; i++)
			E.add(new ArrayList<Integer>());
		for(int i=0; i<n-1; i++) {
			String[] arr = in.readLine().split(" ");
			int x = i(arr[0])-1;
			int y= i(arr[1])-1;
			E.get(x).add(y);
			E.get(y).add(x);
		}
		P = new int[n];
		P[0] = -1;
		root(0, 1);
		System.out.println(ans);
	}
}


import javax.xml.ws.soap.Addressing;
import java.io.*;
import java.lang.reflect.Array;
import java.util.*;

public class Main {
    static ArrayList<Integer>[]adj;
    static int[]dis;
    static double sol;
    static void CalcSize(int u,int p){
        sol+=1.0/dis[u];
        for (int v:adj[u]){
            if (v!=p){
                dis[v]=1+dis[u];
                CalcSize(v,u);
            }
        }
    }
    public  static void main(String[]args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        adj= new ArrayList[n];
        for (int i =0;i<n;i++)adj[i]=new ArrayList<>();
        for (int i =0;i<n-1;i++){
            int u = sc.nextInt()-1;
            int v = sc.nextInt()-1;
            adj[u].add(v);
            adj[v].add(u);
        }
        dis= new  int[n];
        dis[0]=1;
        CalcSize(0,-1);
        pw.println(sol);
        pw.flush();
    }
    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }

        public boolean ready() throws IOException {return br.ready();}

    }
}


import java.io.*;
import java.util.*;

public class Main {
    static ArrayList<Integer>[]adj;
    static int[]dis;
    static double sol;
    static void CalcSize(int u,int p){
        sol+=1.0/dis[u];
        for (int v:adj[u]){
            if (v!=p){
                dis[v]=1+dis[u];
                CalcSize(v,u);
            }
        }
    }
    public  static void main(String[]args) throws Exception {
        Scanner sc = new Scanner(System.in);
        PrintWriter pw = new PrintWriter(System.out);
        int n = sc.nextInt();
        adj= new ArrayList[n];
        for (int i =0;i<n;i++)adj[i]=new ArrayList<>();
        for (int i =0;i<n-1;i++){
            int u = sc.nextInt()-1;
            int v = sc.nextInt()-1;
            adj[u].add(v);
            adj[v].add(u);
        }
        dis= new  int[n];
        dis[0]=1;
        CalcSize(0,-1);
        pw.println(sol);
        pw.flush();
    }
    static class Scanner
    {
        StringTokenizer st;
        BufferedReader br;

        public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

        public String next() throws IOException
        {
            while (st == null || !st.hasMoreTokens())
                st = new StringTokenizer(br.readLine());
            return st.nextToken();
        }

        public int nextInt() throws IOException {return Integer.parseInt(next());}

        public long nextLong() throws IOException {return Long.parseLong(next());}

        public String nextLine() throws IOException {return br.readLine();}

        public double nextDouble() throws IOException
        {
            String x = next();
            StringBuilder sb = new StringBuilder("0");
            double res = 0, f = 1;
            boolean dec = false, neg = false;
            int start = 0;
            if(x.charAt(0) == '-')
            {
                neg = true;
                start++;
            }
            for(int i = start; i < x.length(); i++)
                if(x.charAt(i) == '.')
                {
                    res = Long.parseLong(sb.toString());
                    sb = new StringBuilder("0");
                    dec = true;
                }
                else
                {
                    sb.append(x.charAt(i));
                    if(dec)
                        f *= 10;
                }
            res += Long.parseLong(sb.toString()) / f;
            return res * (neg?-1:1);
        }

        public boolean ready() throws IOException {return br.ready();}

    }
}


#include<bits/stdc++.h>
using namespace std;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(),a.end()
#define SET(a,b) memset(a,b,sizeof(a))
#define off ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
typedef pair<int,int>   II;
typedef vector< II >      VII;
typedef vector<int>     VI;
typedef vector< VI > 	VVI;
typedef long long int 	LL;
typedef vector<LL> 		VL;
#define si(n) cin>>n
#define dout(n) cout<<n<<"\n"
#define DRT() int t; si(t); while(t--)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
//# define M_PI           3.14159265358979323846264338327950288
// DSU
void IO(){
	#ifndef ONLINE_JUDGE
    freopen("../input.txt", "r", stdin);
    freopen("../output.txt", "w", stdout);
	#endif
	srand(chrono::steady_clock::now().time_since_epoch().count());
	off;
}
int n;
VVI g;
VI visited;
double ans = 0.0;
void dfs(int s, int d){
	ans += (1.0/(0.0 + d));
	visited[s] = 1;
	for(auto it : g[s]){
		if(!visited[it]){
			dfs(it, d+1);
		}
	}
}
int main(){
	IO();
	cin>>n;
	g.resize(n);
	visited.resize(n, 0);
	int a,b;
	rep(i,0,n-1){
		cin>>a>>b;
		a--;b--;
		g[a].PB(b);
		g[b].PB(a);
	}
	dfs(0, 1);
	cout<<setprecision(19);
	cout<<ans;
	return 0;
}


#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = INF + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 100 * 1000 + 13;

int n;
vector<int> g[N];

bool read() {
	if (scanf("%d", &n) != 1)
		return false;
	forn(i, n)
		g[i].clear();
	forn(i, n - 1){
		int f, t;
		scanf("%d%d", &f, &t);
		--f, --t;
		g[f].pb(t);
		g[t].pb(f);
	}
	return true;
}

int tin[N], tout[N], T;

bool par(int v, int u){
	return (tin[v] <= tin[u] && tout[v] >= tout[u]);
}

bool used[20];
int pr[N], h[N];
set<vector<int>> res;
vector<int> ord, path;

void naive(int i){
	if (i == n){
		res.insert(path);
		return;
	}
	if (i != n - 1)
		naive(i + 1);
	path.pb(ord[i]);
	naive(i + 1);
	path.pop_back();
}

void init(int v, int p = -1){
	tin[v] = T++;
	pr[v] = p;
	for (auto u : g[v])
		if (u != p){
			h[u] = h[v] + 1;
			init(u, v);
		}
	tout[v] = T++;
	ord.pb(v);
}

void solve() {
	T = 0;
	h[0] = 1;
	init(0);

	/*res.clear();
	memset(used, 0, sizeof(used));
	vector<int> perm(n);
	forn(i, n) perm[i] = i;
	do{
		memset(used, 0, sizeof(used));
		bool fl = true;
		forn(i, n){
			if (pr[perm[i]] != -1 && used[pr[perm[i]]]){
				fl = false;
				break;
			}
			used[perm[i]] = true;
		}
		if (fl){
			ord = perm;
			naive(0);
		}
	} while (next_permutation(all(perm)));
	//cerr << vector<vector<int>>(all(res)) << endl;*/

	ld ans = 0;
	forn(i, n)
		ans += ld(1) / h[i];

	printf("%.15Lf\n", ld(ans));
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int tt = clock();

#endif

	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

#ifdef _DEBUG
	while (read()) {
#else
	if (read()) {
#endif
		solve();

#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}


#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back
#define sqr(a) ((a) * (a))
#define sz(a) int(a.size())
#define all(a) a.begin(), a.end()
#define forn(i, n) for(int i = 0; i < int(n); i++)
#define fore(i, l, r) for(int i = int(l); i < int(r); i++)

typedef long long li;
typedef long double ld;
typedef pair<int, int> pt;

template <class A, class B> ostream& operator << (ostream& out, const pair<A, B> &a) {
	return out << "(" << a.x << ", " << a.y << ")";
}

template <class A> ostream& operator << (ostream& out, const vector<A> &v) {
	out << "[";
	forn(i, sz(v)) {
		if(i) out << ", ";
		out << v[i];
	}
	return out << "]";
}

mt19937 rnd(time(NULL));

const int INF = int(1e9);
const li INF64 = li(1e18);
const int MOD = INF + 7;
const ld EPS = 1e-9;
const ld PI = acos(-1.0);

const int N = 100 * 1000 + 13;

int n;
vector<int> g[N];

bool read() {
	if (scanf("%d", &n) != 1)
		return false;
	forn(i, n)
		g[i].clear();
	forn(i, n - 1){
		int f, t;
		scanf("%d%d", &f, &t);
		--f, --t;
		g[f].pb(t);
		g[t].pb(f);
	}
	return true;
}

int tin[N], tout[N], T;

bool par(int v, int u){
	return (tin[v] <= tin[u] && tout[v] >= tout[u]);
}

li ans, cnt;
bool used[N];
vector<int> ord;

void naive(int i, int len){
	if (i == n){
		ans += len;
		++cnt;
		return;
	}
	if (i != n - 1)
		naive(i + 1, len);
	naive(i + 1, len + 1);
}

void init(int v, int p = -1){
	tin[v] = T++;
	for (auto u : g[v])
		if (u != p)
			init(u, v);
	tout[v] = T++;
	ord.pb(v);
}

void solve() {
	/*T = 0;
	init(0);
	ans = 0;
	cnt = 0;
	memset(used, 0, sizeof(used));
	naive(0, 0);
	printf("%.15Lf ", ld(ans) / cnt);*/
	printf("%.15Lf\n", ld(n + 1) / 2);
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);

	int tt = clock();

#endif

	cerr.precision(15);
	cout.precision(15);
	cerr << fixed;
	cout << fixed;

#ifdef _DEBUG
	while (read()) {
#else
	if (read()) {
#endif
		solve();

#ifdef _DEBUG
	cerr << "TIME = " << clock() - tt << endl;
	tt = clock();
#endif

	}
}


#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define ld long double
#define pi pair<int, int>
#define pb push_back
#define fi first
#define se second
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif

const int N = 2e5 + 5;
const int mod = 1e9 + 7;
const int inf = 1e9 + 9;

ld ans;
vector<int> g[N];

void dfs(int u, int p, int dep){
	ans += 1.0/dep;
	for(auto i: g[u]){
		if(i == p)	continue;
		dfs(i, u, dep+1);
	}
}

signed main() {
	IOS;
	int n;	cin >> n;
	for(int i = 1; i <= n-1; i++){
		int u, v;
		cin >> u >> v;
		g[u].push_back(v);
		g[v].push_back(u);
	}
	dfs(1, 0, 1);
	cout << setprecision(10) << fixed << ans;
	return 0;
}


#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <set>
using namespace std;

int n;
double ans;
vector<int> edge[100010];

void dfs(int u, int l, int depth){
  ans += 1.0 / depth;
  for (int i = 0; i < edge[u].size(); i++){
    int v = edge[u][i];
    if (v != l) dfs(v, u, depth + 1);
  }
}

int main(){
  cin >> n;
  for (int i = 1; i < n; i++){
    int a, b;
    cin >> a >> b;
    edge[a].push_back(b);
    edge[b].push_back(a);
  }

  dfs(1, -1, 1);
  printf("%.10lf", ans);

  return 0;
}


#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<map>
using namespace std;
int a[4][4];
int main()
{
	//freopen("1.in", "r", stdin);
	//freopen("1.out", "w", stdout);
	for(int i = 1; i <= 3; ++i)
		for(int j = 1; j <= 3; ++j)
			cin >> a[i][j];
	a[1][1] = (2 * a[2][3] - a[1][2] + a[2][1]) / 2;
	a[3][3] = (a[1][2] + a[2][1]) / 2;
	a[2][2] = (2 * a[1][3] + a[1][2]- a[2][1]) / 2;
	for(int i = 1; i <= 3; ++i){
		for(int j = 1; j <= 3; ++j)
			cout << a[i][j] << ' ';
			cout << endl;
	}
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int N = 100005;
struct Edge{
    int to, nex;
}edge[N<<1];
int head[N], edgenum;
void add(int u, int v){
    Edge E = {v, head[u]};
    edge[edgenum] = E;
    head[u] = edgenum++;
}
void init(){memset(head ,-1, sizeof head); edgenum = 0;}
int dep[N], n;
void dfs(int u, int fa, int deep){
    dep[u] = deep;
    for(int i = head[u]; ~i; i = edge[i].nex){
        int v = edge[i].to;
        if(v == fa)continue;
        dfs(v, u, deep+1);
    }
}
void input(){
    init();
    for(int i = 1, u, v; i < n; i++)
    {
        cin>>u>>v;
        add(u, v); add(v, u);
    }
}
int main(){
    ios::sync_with_stdio(false);
    while(cin>>n){
        input();
        dfs(1,1,1);
        double ans = 0;
        for(int i = 1; i <= n; i++)
        {
            ans += 1.0/dep[i];
        }
        printf("%.10f\n", ans);
    }
    return 0;
}


#include "bits/stdc++.h"
#include<vector>
#include<iostream>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<iomanip>
#include<assert.h>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<stack>
#include<complex>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps=1e-9;

#define WHATS(var)cout<<__LINE__<<' '<<#var<<"="<<var<<endl;

template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
	os << "( " << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<T> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<vector<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<set<T>> &v){
	for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const set<T> &v){
	int i=0;
	for(auto it:v){
		if(i > 0){os << ' ';}
		os << it;
		i++;
	}
	return os;
}

using ll=long long ;

vector<int>solve(vector<int>v){
	vector<int>nums(1000000,10000000);
	vector<int>anss(v.size());
	nums[0]=0;
	//WHATS(nums)
	for(int i=0;i<v.size();++i){
		auto it=upper_bound(nums.begin(),nums.end(),v[i]);
		anss[i]=it-nums.begin();
		*it=v[i];
		//WHATS(nums)
	}
	return anss;
}
vector<int>ds;
void dfs(int now,int from,const vector<vector<int>>&edges,int d){
	ds[now]=d;
	for(auto e:edges[now]){
		if(e==from)continue;
		else {
			dfs(e,now,edges,d+1);
		}
	}
}
int main() {
	ios::sync_with_stdio(false);
	int N;cin>>N;
	ds.resize(N);
	vector<vector<int>>edges(N);
	for(int i=0;i<N-1;++i){
		int u,v;cin>>u>>v;u--;v--;
		edges[u].push_back(v);edges[v].push_back(u);
	}
	dfs(0,-1,edges,0);
	ld sum=0;
	for(int i=0;i<N;++i)sum+=1/ds[i];
	cout<<setprecision(10)<<fixed<<sum<<endl;

	return 0;
}


#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long int64;

const int64 kInf = (1LL << 40);

namespace fft {

// General Convolution classes.

// DFT uses FFT over the field of complex numbers.
// NTT uses FFT over the field of numbers modulo 2013265921.

// How to use:
// 1. Instantiate an object of class DFT or NTT.
// convolution::DFT dft;
// 2. Call the convolute method on two std::vectors a and b.
// auto c = dft.convolute(a, b);

// In the case of DFT, the types can be double, int or int64.
// In the case of NTT, the types can be int, int64 or unsigned int.

// DFT is faster and works on larger numbers, but may have precision issues.
// NTT should only be used when the inputs and outputs fit in the range
// [-10^9, 10^9] for int or int64, or [0, 2*10^9] for unsigned int.
// The array sizes for NTT should be at most 2^26.

typedef long long int64;
class Complex {
public:
    static constexpr double pi = acos(-1);
    double a, b;

    Complex(double a=0, double b=0) : a(a), b(b) {}

    Complex operator + (const Complex& other) const {
        return Complex(a + other.a, b + other.b);
    }

    Complex operator - (const Complex& other) const {
        return Complex(a - other.a, b - other.b);
    }

    Complex operator * (const Complex& other) const {
        return Complex(a * other.a - b * other.b, a * other.b + b * other.a);
    }

    Complex inverse() const {
        double len = a*a + b*b;
        return Complex(a / len, -b / len);
    }

    static Complex root(int lgsz, int kth=1) {
        return Complex(cos(2*pi*kth / (1<<lgsz)), sin(2*pi*kth / (1<<lgsz)));
    }
};

ostream& operator << (ostream& out, const Complex& c) {
    out << c.a << " + " << c.b << "i";
    return out;
}

void assign(double& d, const Complex& c) {
    d = c.a;
}

int64 myRound(const double& d) {
    return d + (d < 0 ? -0.5 : 0.5);
}

void assign(Complex& myC, const Complex& c) {
	myC = c;
}

void assign(int64& i, const Complex& c) {
    i = myRound(c.a);
}

void assign(int& i, const Complex& c) {
    i = myRound(c.a);
}

class Modular {
  public:
    static const int64 mod = 2013265921;
    static const int64 r = 137;
    static int64 lgpow(int64 x, int64 pw) {
        if (pw == 0)
            return 1;
        auto x2 = lgpow(x, pw>>1);
        if (pw&1)
            return x2*x2%mod*x%mod;
        return x2*x2%mod;
    }
    int64 x;

    Modular(int64 x=0) {
        if (x >= mod || x <= -mod)
            x %= mod;
        this->x = x;
    }

    Modular operator + (const Modular& other) const {
        int64 s = x + other.x;
        if (s >= mod)
            s -= mod;
        return Modular(s);
    }

    Modular operator - (const Modular& other) const {
        int64 d = x - other.x;
        if (d <= -mod)
            d += mod;
        return Modular(d);
    }

    Modular operator * (const Modular& other) const {
        return Modular(x * other.x % mod);
    }

    Modular inverse() {
        return Modular(lgpow(x, mod-2));
    }

    static Modular root(int lgsz, int kth=1) {
        return Modular(lgpow(lgpow(r, 1<<(27-lgsz)), kth));
    }
};

ostream& operator << (ostream& out, const Modular& m) {
    out << m.x;
    return out;
}

void assign(int64& i, const Modular& m) {
    auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
    if (t >= (Modular::mod>>1))
        i = -(Modular::mod - t);
}

void assign(int& i, const Modular& m) {
	auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
    if (t >= (Modular::mod>>1))
        i = -(Modular::mod - t);
}

void assign(unsigned int& i, const Modular& m) {
    auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
}

template<typename C>
class Convolution {
    int sz, lgsz;
    vector<C> roots, invRoots, lhs, rhs, res;
    vector<int> rev;

    static int nextPower2(int sz) {
        int i = 0;
        while ((1<<i) < sz)
            ++i;
        return i;
    }

    void precalc() {
        if (2*sz != roots.size()) {
            roots.resize(2*sz);
            invRoots.resize(2*sz);
            for (int j = (1<<lgsz); j < (1<<(lgsz+1)); ++j) {
                roots[j] = C::root(lgsz, j - (1<<lgsz));
                invRoots[j] = roots[j].inverse();
            }
            for (int j = (1<<lgsz) - 1; j >= 1; --j) {
                roots[j] = roots[j<<1];
                invRoots[j] = invRoots[j<<1];
            }
        }

        if (sz != rev.size()) {
            rev.resize(sz);
            rev[0] = 0;
            for (int i = 1; i < sz; ++i) {
                rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lgsz - 1));
            }
        }
    }

    void prepInverse() {
        res.resize(sz);
        for (int i = 0; i < sz; ++i) {
            res[i] = lhs[i] * rhs[i];
        }
    }

    void fft(vector<C>& c, bool invert) {
        for (int i = 0; i < sz; ++i) {
            if (i < rev[i])
                swap(c[i], c[rev[i]]);
        }

        auto& r = (invert ? invRoots : roots);

        for (int halfStep = 1; halfStep < sz; halfStep <<= 1) {
            for (int start = 0; start < sz; start += (halfStep<<1)) {
                for (int i = 0; i < halfStep; ++i) {
                    C w = r[i + (halfStep<<1)] * c[start + i + halfStep];
                    c[start + i + halfStep] = c[start + i] - w;
                    c[start + i] = c[start + i] + w;
                }
            }
        }

        if (invert) {
            C mult = C(sz).inverse();
            for (int i = 0; i < sz; ++i) {
                c[i] = c[i] * mult;
            }
        }
    }

    template<typename T>
    void toField(vector<C>& c, const vector<T>& a) {
        c.resize(sz);
        for (int i = 0; i < a.size(); ++i)
            c[i] = a[i];
        for (int i = a.size(); i < sz; ++i)
            c[i] = 0;
    }

    template<typename T>
    void fromField(vector<T>& a, const vector<C>& c) {
        a.resize(sz);
        for (int i = 0; i < sz; ++i) {
            assign(a[i], c[i]);
        }
    }

  public:
    template<typename T>
    vector<T> convolute(const vector<T>& lhs, const vector<T>& rhs) {
        lgsz = 1 + nextPower2(max(lhs.size(), rhs.size()));
        sz = (1<<lgsz);
        precalc();
        toField(this->lhs, lhs);
        toField(this->rhs, rhs);
        fft(this->lhs, false);
        fft(this->rhs, false);
        prepInverse();
        fft(this->res, true);
        vector<T> res;
        fromField(res, this->res);
        return res;
    }
};

typedef Convolution<Complex> DFT;
typedef Convolution<Modular> NTT;
};

void Divide(vector<int>& a, int x, vector<int64>& ans, int l, int r) {
	// cerr << l << " " << r << "\n";
	if (l == r) {
		if (a[l] < x)
			ans[1]++;
		else ans[0]++;
		return;
	}
	int mid = (l + r) >> 1;

	vector<int64> left(mid - l + 4), right(r - mid + 4);
	int smaller = 0;
	for (int i = mid; i >= l; --i) {
		if (a[i] < x)
			++smaller;
		left[smaller]++;
	}
	smaller = 0;
	for (int i = mid + 1; i <= r; ++i) {
		if (a[i] < x)
			++smaller;
		right[smaller]++;
	}

	fft::DFT dft;

	auto result = dft.convolute(left, right);
	for (int i = 0; i < result.size() && i < ans.size(); ++i) {
		ans[i] += result[i];
	}

	cout << ans[0] << "\n";

	Divide(a, x, ans, l, mid);
	Divide(a, x, ans, mid + 1, r);
}

void Solve() {
	int n, x;
	cin >> n >> x;

	vector<int> a(n + 1);

	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}

	vector<int64> ans(n + 1);

	Divide(a, x, ans, 1, n);

	for (int i = 0; i <= n; ++i) {
		cout << ans[i] << " ";
	}
}

int main() {
	int tests = 1;

	for (;tests; --tests) {
		Solve();
	}
}


#include <iostream>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

typedef long long int64;

const int64 kInf = (1LL << 40);

namespace fft {

// General Convolution classes.

// DFT uses FFT over the field of complex numbers.
// NTT uses FFT over the field of numbers modulo 2013265921.

// How to use:
// 1. Instantiate an object of class DFT or NTT.
// convolution::DFT dft;
// 2. Call the convolute method on two std::vectors a and b.
// auto c = dft.convolute(a, b);

// In the case of DFT, the types can be double, int or int64.
// In the case of NTT, the types can be int, int64 or unsigned int.

// DFT is faster and works on larger numbers, but may have precision issues.
// NTT should only be used when the inputs and outputs fit in the range
// [-10^9, 10^9] for int or int64, or [0, 2*10^9] for unsigned int.
// The array sizes for NTT should be at most 2^26.

typedef long long int64;
class Complex {
public:
    static constexpr double pi = acos(-1);
    double a, b;

    Complex(double a=0, double b=0) : a(a), b(b) {}

    Complex operator + (const Complex& other) const {
        return Complex(a + other.a, b + other.b);
    }

    Complex operator - (const Complex& other) const {
        return Complex(a - other.a, b - other.b);
    }

    Complex operator * (const Complex& other) const {
        return Complex(a * other.a - b * other.b, a * other.b + b * other.a);
    }

    Complex inverse() const {
        double len = a*a + b*b;
        return Complex(a / len, -b / len);
    }

    static Complex root(int lgsz, int kth=1) {
        return Complex(cos(2*pi*kth / (1<<lgsz)), sin(2*pi*kth / (1<<lgsz)));
    }
};

ostream& operator << (ostream& out, const Complex& c) {
    out << c.a << " + " << c.b << "i";
    return out;
}

void assign(double& d, const Complex& c) {
    d = c.a;
}

int64 myRound(const double& d) {
    return d + (d < 0 ? -0.5 : 0.5);
}

void assign(Complex& myC, const Complex& c) {
	myC = c;
}

void assign(int64& i, const Complex& c) {
    i = myRound(c.a);
}

void assign(int& i, const Complex& c) {
    i = myRound(c.a);
}

class Modular {
  public:
    static const int64 mod = 2013265921;
    static const int64 r = 137;
    static int64 lgpow(int64 x, int64 pw) {
        if (pw == 0)
            return 1;
        auto x2 = lgpow(x, pw>>1);
        if (pw&1)
            return x2*x2%mod*x%mod;
        return x2*x2%mod;
    }
    int64 x;

    Modular(int64 x=0) {
        if (x >= mod || x <= -mod)
            x %= mod;
        this->x = x;
    }

    Modular operator + (const Modular& other) const {
        int64 s = x + other.x;
        if (s >= mod)
            s -= mod;
        return Modular(s);
    }

    Modular operator - (const Modular& other) const {
        int64 d = x - other.x;
        if (d <= -mod)
            d += mod;
        return Modular(d);
    }

    Modular operator * (const Modular& other) const {
        return Modular(x * other.x % mod);
    }

    Modular inverse() {
        return Modular(lgpow(x, mod-2));
    }

    static Modular root(int lgsz, int kth=1) {
        return Modular(lgpow(lgpow(r, 1<<(27-lgsz)), kth));
    }
};

ostream& operator << (ostream& out, const Modular& m) {
    out << m.x;
    return out;
}

void assign(int64& i, const Modular& m) {
    auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
    if (t >= (Modular::mod>>1))
        i = -(Modular::mod - t);
}

void assign(int& i, const Modular& m) {
	auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
    if (t >= (Modular::mod>>1))
        i = -(Modular::mod - t);
}

void assign(unsigned int& i, const Modular& m) {
    auto t = m.x;
    if (t < 0)
        t += Modular::mod;
    i = t;
}

template<typename C>
class Convolution {
    int sz, lgsz;
    vector<C> roots, invRoots, lhs, rhs, res;
    vector<int> rev;

    static int nextPower2(int sz) {
        int i = 0;
        while ((1<<i) < sz)
            ++i;
        return i;
    }

    void precalc() {
        if (2*sz != roots.size()) {
            roots.resize(2*sz);
            invRoots.resize(2*sz);
            for (int j = (1<<lgsz); j < (1<<(lgsz+1)); ++j) {
                roots[j] = C::root(lgsz, j - (1<<lgsz));
                invRoots[j] = roots[j].inverse();
            }
            for (int j = (1<<lgsz) - 1; j >= 1; --j) {
                roots[j] = roots[j<<1];
                invRoots[j] = invRoots[j<<1];
            }
        }

        if (sz != rev.size()) {
            rev.resize(sz);
            rev[0] = 0;
            for (int i = 1; i < sz; ++i) {
                rev[i] = (rev[i >> 1] >> 1) | ((i & 1) << (lgsz - 1));
            }
        }
    }

    void prepInverse() {
        res.resize(sz);
        for (int i = 0; i < sz; ++i) {
            res[i] = lhs[i] * rhs[i];
        }
    }

    void fft(vector<C>& c, bool invert) {
        for (int i = 0; i < sz; ++i) {
            if (i < rev[i])
                swap(c[i], c[rev[i]]);
        }

        auto& r = (invert ? invRoots : roots);

        for (int halfStep = 1; halfStep < sz; halfStep <<= 1) {
            for (int start = 0; start < sz; start += (halfStep<<1)) {
                for (int i = 0; i < halfStep; ++i) {
                    C w = r[i + (halfStep<<1)] * c[start + i + halfStep];
                    c[start + i + halfStep] = c[start + i] - w;
                    c[start + i] = c[start + i] + w;
                }
            }
        }

        if (invert) {
            C mult = C(sz).inverse();
            for (int i = 0; i < sz; ++i) {
                c[i] = c[i] * mult;
            }
        }
    }

    template<typename T>
    void toField(vector<C>& c, const vector<T>& a) {
        c.resize(sz);
        for (int i = 0; i < a.size(); ++i)
            c[i] = a[i];
        for (int i = a.size(); i < sz; ++i)
            c[i] = 0;
    }

    template<typename T>
    void fromField(vector<T>& a, const vector<C>& c) {
        a.resize(sz);
        for (int i = 0; i < sz; ++i) {
            assign(a[i], c[i]);
        }
    }

  public:
    template<typename T>
    vector<T> convolute(const vector<T>& lhs, const vector<T>& rhs) {
        lgsz = 1 + nextPower2(max(lhs.size(), rhs.size()));
        sz = (1<<lgsz);
        precalc();
        toField(this->lhs, lhs);
        toField(this->rhs, rhs);
        fft(this->lhs, false);
        fft(this->rhs, false);
        prepInverse();
        fft(this->res, true);
        vector<T> res;
        fromField(res, this->res);
        return res;
    }
};

typedef Convolution<Complex> DFT;
typedef Convolution<Modular> NTT;
};

void Divide(vector<int>& a, int x, vector<int>& ans, int l, int r) {
	// cerr << l << " " << r << "\n";
	if (l == r) {
		if (a[l] < x)
			ans[1]++;
		else ans[0]++;
		return;
	}
	int mid = (l + r) >> 1;

	vector<int> left(mid - l + 4), right(r - mid + 4);
	int smaller = 0;
	for (int i = mid; i >= l; --i) {
		if (a[i] < x)
			++smaller;
		left[smaller]++;
	}
	smaller = 0;
	for (int i = mid + 1; i <= r; ++i) {
		if (a[i] < x)
			++smaller;
		right[smaller]++;
	}

	fft::DFT dft;

	auto result = dft.convolute(left, right);
	for (int i = 0; i < result.size(); ++i) {
		ans[i] += result[i];
	}

	Divide(a, x, ans, l, mid);
	Divide(a, x, ans, mid + 1, r);
}

void Solve() {
	int n, x;
	cin >> n >> x;

	vector<int> a(n + 1);

	for (int i = 1; i <= n; ++i) {
		cin >> a[i];
	}

	vector<int> ans(n + 1);

	Divide(a, x, ans, 1, n);

	for (int i = 0; i <= n; ++i) {
		cout << ans[i] << " ";
	}
}

int main() {
	int tests = 1;

	for (;tests; --tests) {
		Solve();
	}
}


/*
PROG: cf827e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 500013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<ll> poly;

int TC;
int N;
int arr[MAXN];
int ans;
bool works[MAXN];

ll MOD = (119 << 23) + 1;
const int SZ = (1 << 20);
poly roots(SZ);

ll getpow(ll a, ll e)
{
	if (e == 0)
	{
		return 1ll;
	}
	ll was = getpow(a, e/2);
	if (e % 2)
	{
		return a * (was * was % MOD) % MOD;
	}
	return (was * was % MOD);
}
void poly_debug(poly f, int d)
{
	for (int i = d; i >= 0; i--)
	{
		cerr << "(" << f[i] << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = getpow(3, (MOD - 1) / deg);
	for (int i = 2; i < deg; i++)
	{
		roots[i] = (roots[i - 1] * roots[1]) % MOD;
	}
}
poly ntt(poly f, int deg)
{
	poly g(deg);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = (f[t] + roots[k] * f[t + i]) % MOD;
			}
		}
		swap(f, g);
	}
	return f;
}
poly ntt_rev(poly f, int deg)
{
	f = ntt(f, deg);
	ll isz = getpow(deg, MOD - 2);
	for (int i = 0; i < deg; i++)
	{
		f[i] *= isz; f[i] %= MOD;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
//	cerr << deg << endl;
	poly res(deg);
	if (deg <= 100)
	{
		for (int i = 0; i < deg; i++)
		{
			res[i] = 0;
			for (int j = 0; j <= i; j++)
			{
				res[i] += f[j] * g[i - j];
				res[i] %= MOD;
			}
		}
		return res;
	}
	init(deg);
	f = ntt(f, deg);
	g = ntt(g, deg);
	for (int i = 0; i < deg; i++)
	{
		res[i] = f[i] * g[i] % MOD;
	}
	res = ntt_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf827e.in", "r"))
	{
		freopen ("cf827e.in", "r", stdin);
		freopen ("cf827e.out", "w", stdout);
	}
//		TC = 243;
	cin >> TC;
	while(TC--)
	{
//		N = 5;
		cin >> N;
		string temps;
		cin >> temps;
		ans = 0;
		for (int i = 0; i < N; i++)
		{
//						arr[i] = (rand() % 3) - 1;
			if (temps[i] == '?')
			{
				arr[i] = -1;
			}
			if (temps[i] == 'V')
			{
				arr[i] = 0;
			}
			if (temps[i] == 'K')
			{
				arr[i] = 1;
			}
		}
		int sz = 2 << (32 - __builtin_clz(N));
		poly p(sz), q(sz), r(sz);
		for (int i = 0; i < N; i++)
		{
			if (arr[i] == 1)
			{
				p[N - 1 - i] = 1;
				q[i] = 0;
			}
			if (arr[i] == 0)
			{
				q[i] = 1;
				p[N - 1 - i] = 0;
			}
			if (arr[i] == -1)
			{
				p[N - 1 - i] = 0;
				q[i] = 0;
			}
		}
		r = poly_mult(p, q, sz);
		for (int i = 1; i < N; i++)
		{
			works[i] = !(r[i + N - 1]);
		}
		for (int i = 0; i < N; i++)
		{
			if (arr[i] == 1)
			{
				p[i] = 1;
				q[N - 1 - i] = 0;
			}
			if (arr[i] == 0)
			{
				q[N - 1 - i] = 1;
				p[i] = 0;
			}
			if (arr[i] == -1)
			{
				q[N - 1 - i] = 0;
				p[i] = 0;
			}
		}
		r = poly_mult(p, q, sz);
		for (int i = 1; i < N; i++)
		{
			works[i] &= !(r[i + N - 1]);
		}
		for (int i = N - 1; i > 0; i--)
		{
			for (int j = i; j < N; j += i)
			{
				if (!works[j])
				{
					works[i] = false;
					break;
				}
			}
		}
		for (int i = 1; i < N; i++)
		{
			ans += works[i];
		}
		cout << ans + 1 << '\n';
		for (int i = 1; i < N; i++)
		{
			if (works[i])
			{
				cout << i << ' ';
			}
		}
		cout << N << '\n';
	}
	cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-9;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(deg);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(deg);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	int sz = 2 << (32 - __builtin_clz(N));
	poly p(sz), q(sz), r(sz);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, sz);
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 4e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, SZ);
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
poly roots(1 << 19);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(deg);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (num &x : f)
	{
		x /= deg;
	}
	reverse(f.begin() + 1, f.end());
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(deg);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	int sz = 2 << (32 - __builtin_clz(N));
	poly p(sz), q(sz), r(sz);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, sz);
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-8;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, 2 << (32 - __builtin_clz(N)));
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 1e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(SZ);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(SZ);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	poly p(SZ), q(SZ), r(SZ);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, SZ);
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
//		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}


/*
PROG: cf993e
LANG: C++11
    _____
  .'     '.
 /  0   0  \
|     ^     |
|  \     /  |
 \  '---'  /
  '._____.'
 */
#include <bits/stdc++.h>

using namespace std;

template<class T>
void readi(T &x)
{
	T input = 0;
	bool negative = false;
	char c = ' ';
	while (c < '-')
	{
		c = getchar();
	}
	if (c == '-')
	{
		negative = true;
		c = getchar();
	}
	while (c >= '0')
	{
		input = input * 10 + (c - '0');
		c = getchar();
	}
	if (negative)
	{
		input = -input;
	}
	x = input;
}
template<class T>
void printi(T output)
{
	if (output == 0)
	{
		putchar('0');
		return;
	}
	if (output < 0)
	{
		putchar('-');
		output = -output;
	}
	int aout[20];
	int ilen = 0;
	while(output)
	{
		aout[ilen] = ((output % 10));
		output /= 10;
		ilen++;
	}
	for (int i = ilen - 1; i >= 0; i--)
	{
		putchar(aout[i] + '0');
	}
	return;
}
template<class T>
void ckmin(T &a, T b)
{
	a = min(a, b);
}
template<class T>
void ckmax(T &a, T b)
{
	a = max(a, b);
}
long long randomize(long long mod)
{
	return ((1ll << 30) * rand() + (1ll << 15) * rand() + rand()) % mod;
}

#define MP make_pair
#define PB push_back
#define PF push_front
#define LB lower_bound
#define UB upper_bound
#define fi first
#define se second

const long double PI = 4.0 * atan(1.0);
const long double EPS = 4e-10;

#define MAGIC 347
#define SINF 10007
#define CO 1000007
#define INF 1000000007
#define BIG 1000000931
#define LARGE 1696969696967ll
#define GIANT 2564008813937411ll
#define LLINF 2696969696969696969ll
#define MAXN 200013

long long normalize(long long x, long long mod = INF)
{
	return (((x % mod) + mod) % mod);
}

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef complex<ld> num;
typedef vector<num> poly;

int N, tempval;
bool arr[MAXN];
int lt[MAXN], rt[MAXN];
ll ans[MAXN];
int SZ = (1 << 19); //maybe make it smaller
poly roots(SZ);

void poly_debug(poly f, int deg)
{
	for (int i = deg; i >= 0; i--)
	{
		cerr << "(" << real(f[i]) << ")x^" << i;
		if (i)
		{
			cerr << '+';
		}
		else
		{
			cerr << endl;
		}
	}
	return;
}
void init(int deg)
{
	roots[0] = 1;
	roots[1] = num(cos(2.0 * PI / deg), sin(2.0 * PI / deg));
	for (int i = 2; i < deg; i++)
	{
		roots[i] = roots[i - 1] * roots[1];
	}
}
poly fft(poly f, int deg)
{
	init(deg);
	poly g(deg);
	for (int i = deg / 2; i > 0; i /= 2)
	{
		for (int j = 0; j < i; j++)
		{
			for (int k = 0; k < deg; k += i)
			{
				int t = 2 * k % deg + j;
				g[k + j] = f[t] + roots[k] * f[t + i];
				g[k + j] += EPS;
			}
		}
		swap(f, g);
	}
	return f;
}
poly fft_rev(poly f, int deg)
{
	f = fft(f, deg);
	for (int i = 0; i < deg; i++)
	{
		f[i] /= deg;
	}
	reverse(f.begin() + 1, f.begin() + deg);
	return f;
}
poly poly_mult(poly f, poly g, int deg)
{
	poly res(deg);
	f = fft(f, deg);
	g = fft(g, deg);
	for (int i = 0; i < f.size(); i++)
	{
		res[i] = f[i] * g[i];
	}
	res = fft_rev(res, deg);
	return res;
}

int32_t main()
{
	ios_base::sync_with_stdio(0);
	srand(time(0));
	//	cout << fixed << setprecision(10);
	//	cerr << fixed << setprecision(10);
	if (fopen("cf993e.in", "r"))
	{
		freopen ("cf993e.in", "r", stdin);
		//	freopen ("cf993e.out", "w", stdout);
	}
	cin >> N >> tempval;
	for (int i = 0; i < N; i++)
	{
		int x; cin >> x;
		arr[i] = (bool) (x < tempval);
	}
	//00111
	int pref = 0;
	for (int i = 0; i < N; i++)
	{
		lt[pref]++;
		pref += arr[i];
	}
	for (int i = N - 1; i >= 0; i--)
	{
		rt[pref]++;
		pref -= arr[i];
	}
	int sz = 2 << (32 - __builtin_clz(N));
	poly p(sz), q(sz), r(sz);
	for (int i = 0; i <= N; i++)
	{
//		cerr << lt[i] << ' ';
		p[N - i] = lt[i];
	}
//	cerr << endl;
	for (int i = 0; i <= N; i++)
	{
//		cerr << rt[i] << ' ';
		q[i] = rt[i];
	}
//	cerr << endl;
	r = poly_mult(p, q, sz);
	for (int i = 0; i <= N; i++)
	{
		ans[i] = (ll) (real(r[i + N]) + EPS);
	}
	ans[0] = 1ll * N * (N + 1) / 2;
	for (int i = 1; i <= N; i++)
	{
//		ans[i] = crt(ans1[i], (119 << 23) + 1, ans2[i], (7 << 26) + 1);
		ans[0] -= ans[i];
	}
	cout << ans[0];
	for (int i = 1; i <= N; i++)
	{
		cout << ' ' << ans[i];
	}
	cout << '\n';
		cerr << "time elapsed = " << (clock() / (CLOCKS_PER_SEC / 1000)) << " ms" << endl;
	return 0;
}