{"trustable":true,"prependHtml":"\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eFor an upcoming programming contest, Edward, the headmaster of Marjar University, is forming a two-man team from \u003cvar\u003eN\u003c/var\u003e students of his university.\u003c/p\u003e\n\n\u003cp\u003eEdward knows the skill level of each student. He has found that if two students with skill level \u003cvar\u003eA\u003c/var\u003e and \u003cvar\u003eB\u003c/var\u003e form a team, the skill level of the team will be \u003cvar\u003eA\u003c/var\u003e ⊕ \u003cvar\u003eB\u003c/var\u003e, where ⊕ means bitwise exclusive or. A team will play well if and only if the skill level of the team is greater than the skill level of each team member (i.e. \u003cvar\u003eA\u003c/var\u003e ⊕ \u003cvar\u003eB\u003c/var\u003e \u0026gt; max{\u003cvar\u003eA\u003c/var\u003e, \u003cvar\u003eB\u003c/var\u003e}).\u003c/p\u003e\n\n\u003cp\u003eEdward wants to form a team that will play well in the contest. Please tell him the possible number of such teams. Two teams are considered different if there is at least one different team member.\u003c/p\u003e\n\n\u003ch4\u003eInput\u003c/h4\u003e\n\u003cp\u003eThere are multiple test cases. The first line of input contains an integer \u003cvar\u003eT\u003c/var\u003e indicating the number of test cases. For each test case:\u003c/p\u003e\n\n\u003cp\u003eThe first line contains an integer \u003cvar\u003eN\u003c/var\u003e (2 \u0026lt;\u003d \u003cvar\u003eN\u003c/var\u003e \u0026lt;\u003d 100000), which indicates the number of student. The next line contains \u003cvar\u003eN\u003c/var\u003e positive integers separated by spaces. The \u003cvar\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/var\u003e integer denotes the skill level of \u003cvar\u003ei\u003csup\u003eth\u003c/sup\u003e\u003c/var\u003e student. Every integer will not exceed 10\u003csup\u003e9\u003c/sup\u003e.\u003c/p\u003e\n\n\u003ch4\u003eOutput\u003c/h4\u003e\n\u003cp\u003eFor each case, print the answer in one line.\u003c/p\u003e\n\n\u003ch4\u003eSample\u003c/h4\u003e\n\u003ctable class\u003d\"vjudge_sample\"\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\n3\n1 2 3\n5\n1 2 3 4 5\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e1\n6\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\n"}}]}