#arc127d. [arc127_d]Sum of Min of Xor
[arc127_d]Sum of Min of Xor
Problem Statement
Given are sequences of integers each: and .
Find $\\sum_{1 \\leq i < j \\leq N} \\min(A_i \\oplus A_j, B_i \\oplus B_j)$, where denotes the bitwise XOR.
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
1 2 3
4 5 6
Sample Output 1
4
Thus, the answer is .
Sample Input 2
4
1 2 3 4
1 2 3 4
Sample Output 2
24
Sample Input 3
10
195247 210567 149398 9678 23694 46151 187762 17915 176476 249828
68649 128425 249346 62366 194119 117620 26327 161384 207 57656
Sample Output 3
4019496