atcoder#ARC092B. [ABC091D] Two Sequences
[ABC091D] Two Sequences
Score : points
Problem Statement
You are given two integer sequences, each of length : and .
There are ways to choose two integers and such that . For each of these pairs, we will compute and write it on a sheet of paper. That is, we will write integers in total.
Compute the XOR of these integers.
Definition of XOR
The XOR of integers is defined as follows:
- Let the XOR be . In the binary representation of , the digit in the 's place (; is an integer) is if there are an odd number of integers among whose binary representation has in the 's place, and if that number is even.
For example, let us compute the XOR of and . The binary representation of is , and the binary representation of is , thus the XOR has the binary representation , that is, the XOR is .
Constraints
- All input values are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the result of the computation.
2
1 2
3 4
2
On the sheet, the following four integers will be written: and .
6
4 6 0 0 3 3
0 5 6 5 0 3
8
5
1 2 3 4 5
1 2 3 4 5
2
1
0
0
0