| The 2018 ACM-ICPC Asia Qingdao Regional Contest, Online (The 2nd Universal Cup. Stage 1: Qingdao) |
|---|
| Закончено |
BaoBao has a sequence a1, a2, ..., an. He would like to find a subset S of {1, 2, ..., n} such that
,
and |S| is maximum, where
means bitwise exclusive or.
There are multiple test cases. The first line of input contains an integer T, indicating the number of test cases. For each test case:
The first line contains an integer n (1 ≤ n ≤ 105), indicating the length of the sequence.
The second line contains n integers: a1, a2, ..., an (1 ≤ ai ≤ 109), indicating the sequence.
It is guaranteed that the sum of n in all cases does not exceed 105.
For each test case, output an integer denoting the maximum size of S.
3
3
1 2 3
3
1 1 1
5
1 2323 534 534 5
2
3
2
| Название |
|---|


