P19555 [HackerEarth] In this problem you will be doing some funny operations. These operations are basically a mixture of bitwise operations. You will be given a set of distinct numbers. You have to tell me
普及-
题目描述

In this problem you will be doing some funny operations. These operations are basically a mixture of bitwise operations. You will be given a set of distinct numbers. You have to tell me the maximum value of P that can be obtained in any subset of that array. P is defined below :

P = (XOR of all of the values in subset) OR (AND of all of the values in subset)

Here XOR , AND and OR are the bitwise operations.
If multiple maximum value of P are possible then consider the subset with maximum length.

Input
First line of the input will contain T (no. of test cases). Then every test case will contain two lines. First line will have the value of N then the next line will have N space separated integers of set.
Output
For every test case, print the maximum value of P and then maximum length of the resultant subset.
Constraints
1 ≤ T ≤ 10
1 ≤ N ≤ 16
0 ≤ values of set ≤ 10^9

SAMPLE INPUT
1
3
1 2 3

SAMPLE OUTPUT
3 2

Explanation

One of the resultant subset is {1, 2}.

输入格式

见题面

输出格式

见题面

样例输入
10 16 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 16 7 19 25 12 18 1 20 28 8 6 4 9 14 24 21 2 16 3 21 6 20 25 22 29 28 13 15 19 11 24 8 12 1 16 21 28 5 3 13 27 6 23 20 9 25 1 8 29 10 15 16 0 27 18 26 22 15 13 24 17 25 2 6 29 12 14 20 16 27 2 9 3 15 5 23 6 28 12 18 16 22 24 17 29 16 28 22 17 0 7 27 26 11 18 23 6 9 12 13 25 19 16 10 0 9 19 11 16 22 6 27 2 23 5 15 7 29 21 16 0 8 12 28 22 16 1 27 10 6 13 7 5 17 18 26
样例输出
31 15 15 15 31 15 31 14 31 14 31 14 31 14 31 14 31 15 31 15