CF1658D1.388535 (Easy Version)

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 22 integers ll and rr such that lrl \leq r .
  • Then, Gojou makes an array aa of length rl+1r-l+1 which is a permutation of the array [l,l+1,,r][l,l+1,\ldots,r] .
  • Finally, Gojou chooses a secret integer xx and sets aia_i to aixa_i \oplus x for all ii (where \oplus denotes the bitwise XOR operation).

Marin is then given the values of l,rl,r and the final array aa . She needs to find the secret integer xx to win. Can you help her?

Note that there may be multiple possible xx that Gojou could have chosen. Marin can find any possible xx that could have resulted in the final value of aa .

输入格式

The first line contains a single integer tt ( 1t1051 \leq t \leq 10^5 ) — the number of test cases.

In the first line of each test case contains two integers ll and rr ( $ \color{red}{\boldsymbol{0} \boldsymbol{=} \boldsymbol{l}} \le r < 2^{17}$ ).

The second line contains rl+1r - l + 1 integers of a1,a2,,arl+1a_1,a_2,\ldots,a_{r-l+1} ( 0ai<2170 \le a_i < 2^{17} ). It is guaranteed that aa can be generated using the steps performed by Gojou.

It is guaranteed that the sum of rl+1r - l + 1 over all test cases does not exceed 2172^{17} .

输出格式

For each test case print an integer xx . 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

    输出#1

    0
    4
    3

说明/提示

In the first test case, the original array is [3,2,1,0][3, 2, 1, 0] .

In the second test case, the original array is [0,3,2,1][0, 3, 2, 1] .

In the third test case, the original array is [2,1,0][2, 1, 0] .

首页