Time Limit: 5000/2500 MS (Java/Others)
There is a nonnegative integer sequence $a_1…n$ of length $n$. HazelFan wants to do a type of transformation called prefix-XOR, which means a1…n changes into b1…n, where bi equals to the $XOR$ value of $a_1,…,a_i$. He will repeat it for $m$ times, please tell him the final sequence.

Input

The first line contains a positive integer $T(1≤T≤5)$, denoting the number of test cases.
For each test case:
The first line contains two positive integers $n,m(1≤n≤2×10^5,1≤m≤10^9)$.
The second line contains $n$nonnegative integers $a_1…n$ $(0≤a_i≤2^30−1)$.

Output

For each test case:
A single line contains $n$ nonnegative integers, denoting the final sequence.

Sample Input

2
1 1
1
3 3
1 2 3


Sample Output

1
1 3 1


Source

2017 Multi-University Training Contest – Team 7

题解：

}
}


This site uses Akismet to reduce spam. Learn how your comment data is processed.