#Lutece1862. Delta

Delta

Migrated from Lutece 1862 Delta

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

The math teacher Fish Nineone assigned Delta homework. Delta is given a set of NN integers. The requirement is find the minimum number of intergers inserting to the set that for every two integers AA and BB in set, ABA \oplus B ( bitwise exclusive OR ) is also in the set.

Delta is poor in math, so that she asks you to solve this problem to get one Accepted in the 16th UESTC programming contest.

Input

The first line is an integer TT, which indicates the number of testcases.

For each testcase:

The first line of the input file contains the integer NN ( 1N21051 \leq N \leq 2 \cdot 10^5 ).

In the second line, NN numbers follow ( 0ai10180 \leq a_i \leq 10^{18} ).

You can assume that N2106\sum N \leq 2 \cdot 10^6.

Output

For each testcase, your program should output the minimum number of intergers inserting in one line.

Samples

1
3
2 4 6
1
1
5
2 4 5 7 11
11

Note

In the second example, all numbers from 0 to 15 should in the set.

number 88 is in the set as follow:

45=14 \oplus 5 = 1,

12=31 \oplus 2 = 3,

311=83 \oplus 11 = 8 ...

Resources

The 16th UESTC Programming Contest Preliminary