# MEX-OR solution codechef

The MEX (minimum excluded) of an array is the smallest non-negative integer that does not belong to the array. For instance:

• The MEX of [2,2,1][2,2,1] is 00, because 00 does not belong to the array.
• The MEX of [3,1,0,1][3,1,0,1] is 22, because 00 and 11 belong to the array, but 22 does not.
• The MEX of [0,3,1,2][0,3,1,2] is 4 because 0,1,20,1,2 and 33 belong to the array, but 44 does not.

Find the maximum possible MEX of an array of non-negative integers such that the bitwise OR of the elements in the array does not exceed XX.

## Input Format MEX-OR solution codechef

• The first line contains TT denoting the number of test cases. Then the test cases follow.
• Each test case contains a single integer XX on a single line.

### Output Format MEX-OR solution codechef

For each test case, output on a single line the maximum possible MEX of the array satisfying the given property.

### Constraints MEX-OR solution codechef

• 1T1051≤T≤105
• 0X1090≤X≤109

Subtask 1 (100 points): Original constraints

### Sample Input 1 MEX-OR solution codechef

4
0
1
2
5


### Sample Output 1 MEX-OR solution codechef

1
2
2
4


## Explanation MEX-OR solution codechef

Test case 11: The array could be .

Test case 22: The array could be [0,1][0,1]. Here the bitwise OR of 00 and 11 is 11 and the MEX of the array is 22 as both 00 and 11 belongs to the array. MEX-OR solution codechef

Test case 44: The array could be [1,0,3,2][1,0,3,2]. Here the bitwise OR of all integers in the array is 33 and the MEX of the array is 44.

## MEX-OR solution codechef

Finally, progress reached the Madoka family and she decided to play with her little sister in the sensational game Space Arrays.

The rules of the game are as follows:

• Initially, a sequence a1,a2,,aNa1,a2,…,aN is given.
• The players alternate turns.
• In each turn, the current player must choose an index ii and increment aiai, i.e. change aiai to ai+1ai+1.
• Afterwards, if there is no permutation p1,p2,,pNp1,p2,…,pN of the integers 11 through NN such that aipiai≤pi holds for each valid ii, the current player loses.
• Otherwise, the game continues with the next turn.

Madoka is asking you to help her ― tell her if the first player (the player that plays in the first turn) or second player wins this game if both play optimally.

### Input MEX-OR solution codechef

• The first line of the input contains a single integer TT denoting the number of test cases. The description of TT test cases follows.
• The first line of each test case contains a single integer NN.
• The second line contains NN space-separated integers a1,a2,,aNa1,a2,…,aN.

### Output MEX-OR solution codechef

For each test case, print a single line containing the string "First" if the first player wins or "Second" if the second player wins (without quotes).

### Constraints MEX-OR solution codechef

• 1T21041≤T≤2⋅104
• 1N21051≤N≤2⋅105
• The sum of NN over all test cases doesn’t exceed 21052⋅105
• 1aiN1≤ai≤N for each valid ii

Subtask #1 (100 points): Original constraints

### Sample Input 1  MEX-OR solution codechef

4
4
1 2 3 3
4
1 1 3 3
5
1 2 2 1 5
3
2 2 3


### Sample Output 1 MEX-OR solution codechef

First
Second
Second
Second


### Explanation MEX-OR solution codechef

Example case 1: MEX-OR solution codechef

• If the first player increases the fourth element, the resulting sequence is (1,2,3,4)(1,2,3,4). The second player loses after increasing any of the elements.
• If the first player increases the second element, the resulting sequence is (1,3,3,3)(1,3,3,3), and he loses because there is no valid permutation. For example if p=(2,1,4,3)p=(2,1,4,3), the second element of aa is greater than the second element of pp.