#C6173. Maximum Pairwise XOR Sum
Maximum Pairwise XOR Sum
Maximum Pairwise XOR Sum
You are given a list of n non-negative integers. Your task is to compute the sum of the bitwise XOR of all distinct pairs of numbers in the list. In other words, if the list is \(A = [a_1, a_2, \dots, a_n]\), you need to calculate:
$$\sum_{1 \le i < j \le n} (a_i \oplus a_j),$$
where \(\oplus\) denotes the bitwise XOR operation. This problem tests your ability to work with bit manipulation and arithmetic properties.
Note: The input is read from the standard input and the output should be printed to the standard output.
inputFormat
The first line contains an integer n (the number of elements). The second line contains n space-separated integers representing the elements of the list.
outputFormat
Output a single integer: the sum of the bitwise XOR for all pairs of the given list.
## sample3
1 2 3
6
</p>