#arc156d. [arc156_d]Xor Sum 5
[arc156_d]Xor Sum 5
Problem Statement
You are given a sequence of non-negative integers and a positive integer .
Find the bitwise of over all sequences of positive integer sequences such that .
What is bitwise ?
The bitwise of non-negative integers and , , is defined as follows:
- When is written in base two, the digit in the 's place () is if exactly one of the digits in that place of and is , and otherwise.
For example, we have (in base two: ).
Generally, the bitwise of non-negative integers is defined as $(\\dots ((p_1 \\oplus p_2) \\oplus p_3) \\oplus \\dots \\oplus p_k)$. We can prove that this value does not depend on the order of .
Constraints
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2 2
10 30
Sample Output 1
40
There are four sequences to consider: , for which is , respectively. Thus, the answer is .
Sample Input 2
4 10
0 0 0 0
Sample Output 2
0
Sample Input 3
11 998244353
314 159 265 358 979 323 846 264 338 327 950
Sample Output 3
236500026047