$$$\textit{KaitoKid}$$$ is a skilled problem solver, but he's still upset about losing the last ACPC contest to $$$\textit{UnitedBugaC}$$$. Now, he's planning to break their alliance with a secret plan that he needs your help with.
$$$\textit{KaitoKid}$$$ has $$$n$$$ friends, and he assigned a mysterious value $$$a_i$$$ to each one. He wants to take some of his friends with him, but only those who are $$$\textit{close}$$$ to each other. specifically, he wants the people who will go with him to have a degree of $$$\textit{closeness}$$$ equals to $$$x$$$.
The degree of $$$\textit{closeness}$$$ between friends is calculated as the bitwise $$$\textbf{AND}$$$ of their values. In other words, the degree of $$$\textit{closeness}$$$ between friends with values $$$b_1, b_2, \dots, b_k$$$ is: $$$b_1 \& b_2 \& \dots \& b_k$$$ where $$$\&$$$ represents the bitwise $$$\textbf{AND}$$$ operator.
$$$\textit{KaitoKid}$$$ is in a dilemma: he doesn't know how many friends he should take with him, and he's afraid to go alone. Could you help him figure out the maximum number of friends he can take with him? If no one can go with him, output $$$-1$$$.
Join $$$\textit{KaitoKid}$$$ on his mission and use your problem solving skills to save the day!
The first line contains an integer $$$t$$$ $$$(1 \le t \le 5\times 10^5)$$$ — the number of test cases. The descriptions of the test cases follow.
The first line contains two integers $$$n$$$ and $$$x$$$ $$$(1 \le n \le 10^5 , 0 \le x \le 10^8)$$$ — the number of $$$\textit{KaitoKid}$$$'s friends and the desired degree of closeness between the friends who will go with him to complete his mission.
The second line contains $$$n$$$ integers $$$a_1, a_2, \dots , a_n$$$ $$$(0 \le a_i \le 10^8)$$$ — the mysterious value of $$$\textit{KaitoKid}$$$'s friends.
It is guaranteed that sum of $$$n$$$ over all test cases doesn't exceed $$$5\times10^5$$$.
For each test case, If no one can go with $$$\textit{KaitoKid}$$$, output $$$-1$$$. Otherwise, output the maximum number of friends he can take with him.
36 07 3 5 2 8 44 22 4 7 62 13 7
6 3 -1
In the first test case, all $$$6$$$ friends can go because their bitwise AND value is $$$0$$$, which satisfies the degree of $$$\textit{closeness}$$$ requirement.
In the second case, only the first, third and fourth friends can go because $$$a_1 \& a_3 \& a_4 = 2 \& 7 \& 6 = 2$$$, which satisfies the degree of $$$\textit{closeness}$$$ requirement.
| Название |
|---|


