Nasser was thinking about arrays and noticed he wanted to challenge himself with bitwise operations. He created the following task:
Nasser is given an array of integers, and he wants to make all the elements equal.
He can perform the following operation any number of times (possibly zero):
use xor basis
Select an index (1 \le i \le n), choose an integer (1 \le x \le 10^{10}), and replace a_i with a_i \,|\, x.
Here, the symbol | represents the bitwise OR operation. For two integers and , the result of is a number whose binary representation has a in each bit position where either or has a . For example, 5 \,|\, 3 = 7 because (101)_2 \,|\, (011)_2 = (111)_2.
Nasser asked himself:
"What is the minimum number of operations needed to make all the elements in the array equal?"
Each test contains multiple test cases. The first line contains a single integer (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 (1 \le n \le 2 \cdot 10^5) — the size of the array.
The second line of each test case contains integers a_1, a_2, \ldots, a_n (1 \le a_i \le 10^9) — the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.
For each test case, print a single integer — the minimum number of operations needed to make all the elements equal.
Example 1
Subtask ( points) : (1 \le a_i \le 2)
Subtask ( points) : (a_i=2^k) i.e. a_i is a power of .
Subtask ( points) : No additional constraints.