#K43102. Encryption Key

    ID: 27235 Type: Default 1000ms 256MiB

Encryption Key

Encryption Key

You are given two arrays of integers, B and C, where the arrays have equal length m and they satisfy the relation

\(C[i] = B[i] \oplus K\)

for all \(0 \leq i < m\), where \(K\) is an unknown encryption key and \(\oplus\) denotes the bitwise XOR operation. Your task is to determine the encryption key \(K\). Note that since the relationship holds for every index, you can compute \(K\) by selecting any valid index \(i\) and evaluating \(K = B[i] \oplus C[i]\).

Input/Output Interaction: The program reads from standard input and outputs the result to standard output.

inputFormat

The input is given via standard input and has the following format:

T
m
B[0] B[1] ... B[m-1]
C[0] C[1] ... C[m-1]
... (repeated for T test cases)

Where:

  • T is the number of test cases.
  • For each test case, an integer m denotes the length of the arrays B and C.
  • The next line contains m space-separated integers representing array B.
  • The following line contains m space-separated integers representing array C.

outputFormat

For each test case, output a single line containing the encryption key \(K\), computed using the relation \(C[i] = B[i] \oplus K\).

## sample
3
4
5 7 9 11
2 4 0 6
3
10 20 30
0 30 20
3
25 25 25
8 8 8
7

10 17

</p>