{"trustable":true,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027$$$$$$\u0027, right: \u0027$$$$$$\u0027, display: true},\n {left: \u0027$$$\u0027, right: \u0027$$$\u0027, display: false},\n {left: \u0027$$\u0027, right: \u0027$$\u0027, display: true},\n {left: \u0027$\u0027, right: \u0027$\u0027, display: false}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"epigraph\"\u003e\u003cdiv class\u003d\"epigraph-text\"\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eExcess is just as bad as deficiency.\u003c/span\u003e\u003c/div\u003e\u003cdiv class\u003d\"epigraph-source\"\u003e— Confucius, \u003cspan class\u003d\"tex-font-style-it\"\u003eThe Analects\u003c/span\u003e\u003c/div\u003e\u003c/div\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eOP\u003c/span\u003e, a senior high school student, had fallen in love with the \u003cspan class\u003d\"tex-font-style-bf\"\u003ebitwise XOR operation\u003c/span\u003e.\u003c/p\u003e\u003cp\u003eSo is there anything that can be done for \u003cspan class\u003d\"tex-font-style-it\"\u003eOP\u003c/span\u003e? Don\u0027t worry, \u003cspan class\u003d\"tex-font-style-it\"\u003eCY\u003c/span\u003e has a wonderful idea.\u003c/p\u003e\u003cp\u003e\u003cspan class\u003d\"tex-font-style-it\"\u003eCY\u003c/span\u003e gives \u003cspan class\u003d\"tex-font-style-it\"\u003eOP\u003c/span\u003e an array $$$a$$$ consisting of exactly $$$n$$$ numbers and a non-negative integer $$$k$$$. And then, \u003cspan class\u003d\"tex-font-style-it\"\u003eCY\u003c/span\u003e throws him a question:\u003c/p\u003e\u003cp\u003eHow many pairs $$$(i,j)$$$ $$$(1 \\leq i\u0026lt;j \\leq n)$$$ satisfy $$$a_i \\oplus a_j \u003d k$$$? Here $$$\\oplus$$$ denotes the \u003cspan class\u003d\"tex-font-style-bf\"\u003ebitwise XOR operation\u003c/span\u003e$$$^{\\dagger}$$$.\u003c/p\u003e\u003cp\u003e$$$^{\\dagger}$$$ \u003cspan class\u003d\"tex-font-style-bf\"\u003eBitwise XOR operation\u003c/span\u003e is a binary operation that takes two bit patterns of equal length and performs the \u003cspan class\u003d\"tex-font-style-it\"\u003elogical exclusive OR operation\u003c/span\u003e on each pair of corresponding bits. The result in each position is $$$\\mathtt{1}$$$ if only one of the bits is $$$\\mathtt{1}$$$, but will be $$$\\mathtt{0}$$$ if both are $$$\\mathtt{0}$$$ or both are $$$\\mathtt{1}$$$. In this, we perform the comparison of two bits, being $$$\\mathtt{1}$$$ if the two bits are different, and $$$\\mathtt{0}$$$ if they are the same. For example:\u003c/p\u003e\u003cpre class\u003d\"lstlisting\"\u003e\u003ccode class\u003d\"prettyprint\"\u003e 0101 (decimal 5)\nXOR 0011 (decimal 3)\n \u003d 0110 (decimal 6)\n\u003c/code\u003e\u003c/pre\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003eThe first line contains a single integer $$$t$$$ $$$(1 \\leq t \\leq 10 ^ 4)$$$, denoting the number of test cases.\u003c/p\u003e\u003cp\u003eThe first line of each test case contains two integers $$$n$$$, $$$k$$$ $$$(1 \\leq n \\leq 2 \\times 10 ^ 5, 0 \\leq k \\leq 10 ^ 9)$$$.\u003c/p\u003e\u003cp\u003eThe second line contains exactly $$$n$$$ integers $$$a_1, a_2, \\ldots, a_n$$$ $$$(0 \\leq a_i \\leq 10 ^ 9)$$$.\u003c/p\u003e\u003cp\u003eIt\u0027s guaranteed that the sum of $$$n$$$ over all test cases doesn\u0027t exceed $$$2 \\times 10 ^ 5$$$.\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003eFor each test case, output a single integer, denoting the number of pairs $$$(i, j)$$$ satisfying $$$a_i \\oplus a_j \u003d k$$$.\u003c/p\u003e"}},{"title":"Examples","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\n6 1\n1 1 4 5 1 4\n7 0\n1 9 1 9 8 1 0\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n4\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"Note","value":{"format":"HTML","content":"\u003cp\u003eIn the first test case, only two pairs $$$(3, 4)$$$, $$$(4, 6)$$$ satisfy the constraint: $$$a_3 \\oplus a_4\u003da_4 \\oplus a_6 \u003d 1$$$.\u003c/p\u003e\u003cp\u003eIn the second test case, there are four pairs $$$(1, 3)$$$, $$$(1, 6)$$$, $$$(2, 4)$$$, $$$(3, 6)$$$ satisfy the constraint: $$$a_1 \\oplus a_3\u003da_1 \\oplus a_6 \u003d a_2 \\oplus a_4 \u003d a_3 \\oplus a_6 \u003d 0$$$.\u003c/p\u003e"}}]}