{"raw_statement":[{"iden":"problem statement","content":"You are given a sequence of $N$ non-negative integers $A=(A_1,A_2,\\dots,A_N)$ and a positive integer $K$.\nFind the bitwise $\\mathrm{XOR}$ of $\\displaystyle \\sum_{i=1}^{K} A_{X_i}$ over all $N^K$ sequences of $K$ positive integer sequences $X=(X_1,X_2,\\dots,X_K)$ such that $1 \\leq X_i \\leq N\\ (1\\leq i \\leq K)$.\nWhat is bitwise $\\mathrm{XOR}$?The bitwise $\\mathrm{XOR}$ of non-negative integers $A$ and $B$, $A \\oplus B$, is defined as follows:\n\n*   When $A \\oplus B$ is written in base two, the digit in the $2^k$'s place ($k \\geq 0$) is $1$ if exactly one of the digits in that place of $A$ and $B$ is $1$, and $0$ otherwise.\n\nFor example, we have $3 \\oplus 5 = 6$ (in base two: $011 \\oplus 101 = 110$).  \nGenerally, the bitwise $\\mathrm{XOR}$ of $k$ non-negative integers $p_1, p_2, p_3, \\dots, p_k$ 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 $p_1, p_2, p_3, \\dots, p_k$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 1000$\n*   $1 \\leq K \\leq 10^{12}$\n*   $0 \\leq A_i \\leq 1000$\n*   All values in the input are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$N$ $K$\n$A_1$ $A_2$ $\\dots$ $A_N$"},{"iden":"sample input 1","content":"2 2\n10 30"},{"iden":"sample output 1","content":"40\n\nThere are four sequences to consider: $(X_1,X_2)=(1,1),(1,2),(2,1),(2,2)$, for which $A_{X_1}+A_{X_2}$ is $20,40,40,60$, respectively. Thus, the answer is $20 \\oplus 40 \\oplus 40 \\oplus 60=40$."},{"iden":"sample input 2","content":"4 10\n0 0 0 0"},{"iden":"sample output 2","content":"0"},{"iden":"sample input 3","content":"11 998244353\n314 159 265 358 979 323 846 264 338 327 950"},{"iden":"sample output 3","content":"236500026047"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}