Yash and another easy XOR question

0

0 votes
Easy
Problem

This time your task is very easy.

You are given 2 arrays A and B both containing n elements each.

You have to arrange array B in such a way such that the sum of XOR of elements placed at position  i  is maximum i.e Arrange array B in such a way such that Σ(A[i]XORB[i]) for all i from 1 to n is maximum.You have to output the 

sum.


INPUT

First line of input contains a single integer N denoting the size of the array.

Next line contains 'N' space separated integers denoting array A.

Next line contains 'N' space separated integers denoting array B.


OUTPUT

Output the single integer as asked in the question.


CONSTRAINTS

1N17

1A[i]109

Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?