PICK UP DROP ESCAPE
You are given with an array of n numbers. You must pick K elements from the array such that XOR of all the chosen elements is maximum.
http://en.wikipedia.org/wiki/Bitwise_operation#XOR
Input Specification:
The first line consists of an integer t representing the number of test cases. For each test case the first line consists of two numbers n and K denoting the number of elements in the array and the number of elements to be chosen respectively. Then in the next n lines, the elements in the array are given.
Output Specification:
For each test case print a line containing one integer denoting the maximum XOR value of the chosen K elements.
Input Constraints:
1<=t<=100
1<=n<=20
1<=k<=n
1<=element value<=10000
Sample Input:
2
5 3
1
2
3
4
5
5 3
3
4
5
7
4
Sample Output:
7
7