#L7990. [USACO21DEC] Closest Cow Wins S
[USACO21DEC] Closest Cow Wins S
CF1658D1 388535 (Easy Version)
题目描述
This is the easy version of the problem. The difference in the constraints between both versions is colored below in red. You can make hacks only if all versions of the problem are solved.
Marin and Gojou are playing hide-and-seek with an array.
Gojou initially performs the following steps:
- First, Gojou chooses integers and such that .
- Then, Gojou makes an array of length which is a permutation of the array .
- Finally, Gojou chooses a secret integer and sets to for all (where denotes the bitwise XOR operation).
Marin is then given the values of and the final array . She needs to find the secret integer to win. Can you help her?
Note that there may be multiple possible that Gojou could have chosen. Marin can find any possible that could have resulted in the final value of .
输入格式
The first line contains a single integer ( ) — the number of test cases.
In the first line of each test case contains two integers and ( $ \color{red}{\boldsymbol{0} \boldsymbol{=} \boldsymbol{l}} \le r < 2^{17} $ ).
The second line contains integers of ( ). It is guaranteed that can be generated using the steps performed by Gojou.
It is guaranteed that the sum of over all test cases does not exceed .
输出格式
For each test case print an integer . If there are multiple answers, print any.
输入输出样例 1
3
0 3
3 2 1 0
0 3
4 7 6 5
0 2
1 2 3
0
4
3
说明/提示
In the first test case, the original array is .
In the second test case, the original array is .
In the third test case, the original array is .