Given an array of integers $$$a$$$ of length $$$n$$$. Let's say that segment $$$[l,r]$$$ is $$$i$$$-$$$th \: good$$$ if:
For each $$$i$$$ from $$$1$$$ to $$$n$$$, count all segments which are $$$i$$$-$$$th \: good$$$.
Here $$$\&$$$ denotes the bitwise AND operation.
Each test consists of multiple test cases. The first line contains a single integer $$$t$$$ $$$(1 \le t \le 10^4)$$$ — the number of test cases. The description of the test cases follows.
The first line of each test case contains a single integer $$$n$$$ $$$(1 \le n \le 10^5)$$$ — the length of the array $$$a$$$.
The second line of each test case contains $$$n$$$ integers $$$a_1, a_2, \ldots, a_n$$$ $$$(1 \le a_i \le 10^6)$$$ — the elements of the array $$$a$$$.
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$10^5$$$.
For each test case, output $$$n$$$ integers on a single line — the number of $$$i$$$-$$$th \: good$$$ segments for each $$$i$$$ $$$(1 \le i \le n)$$$.
2 5 3 7 6 2 10 5 4 1 3 1 4
2 1 2 8 1 1 3 1 3 1
For the first test case, $$$a=[3,7,6,2,10]$$$.
| Name |
|---|


