407675: GYM102870 E Encryption of Orz Pandas

Memory Limit:512 MB Time Limit:5 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

E. Encryption of Orz Pandastime limit per test5 secondsmemory limit per test512 megabytesinputstandard inputoutputstandard output

An Orz Panda agent has some data which should be encrypted. He has store the data into a list a with length n. To encrypt it, he'll run the following loop (wrote in Python) for $$$k$$$ times:

for i in range(1, n):
a[i] ^= a[i-1]

Please output the content of the list a after the encryption.

Input

There is only one test case in the input file.

The first line contains two integers $$$n$$$ and $$$k$$$, seperated by a whitespace.

The second line contains $$$n$$$ integers $$$a_0, a_1, \cdots, a_{n-1}$$$, the elements in the list a. Each adjacent pair of integers are seperated by a whitespace.

It's guaranteed that $$$1 \leq n \leq 10^5$$$, $$$0 \leq a_i < 2^{17}$$$, and $$$1 \leq k \leq 10^{18}$$$.

Output

Output one line, containing $$$n$$$ integers in the encrypted list a. Each adjacent pair of integers should be seperated by a whitespace. There should be no trailing whitespaces.

ExampleInput
6 5
1 0 5 1 5 5
Output
1 1 4 5 1 4
Note

For the example:

  • The list should become [1,1,4,5,0,5] after the first iteration
  • The list should become [1,0,4,1,1,4] after the second iteration
  • The list should become [1,1,5,4,5,1] after the third iteration
  • The list should become [1,0,5,1,4,5] after the fourth iteration
  • The list should become [1,1,4,5,1,4] after the fifth iteration, and you should output it

加入题单

算法标签: