You are given an array A having N integers and an integer X. Find the length of the longest non-empty subsequence of the array A such that the Bitwise AND of the elements of the subsequence is greater than or equal to X. Print −1 if no such subsequence exists.
A subsequence is a sequence that can be derived from the given sequence by deleting zero or more elements without changing the order of the remaining elements.
Input format
Output format
For each test case, print −1 if no subsequence satisfies the given condition. Otherwise, print the length of the longest non-empty subsequence in a separate line.
Constraints
1≤T≤1041≤N≤1051≤Ai,X<230Sum of N over all test cases does not exceed 3⋅105.