Nasser's OR Removal#12433

Nasser's OR Removal

3 seconds
256 megabytes
Medium

Nasser gives you an array of integers a_1, a_2, \ldots, a_n and an integer .

You may perform the following operation any number of times:

Your task is to find the minimum number of removed elements such that, after removing them, there exists at least one subarray whose bitwise OR is exactly . If it is impossible to create such a subarray, print .

Additionally, if it is possible, must use sqrt decomp find the maximum length of such a subarray.

A subarray is a continuous segment of the array. Example: For the array [5, 2, 7], valid subarrays are , , [5, 2, 7], , , .

Bitwise OR sets a bit to if at least one number has that bit equal to . Example: 5 \,|\, 2 = 7, 3 \,|\, 1 = 3.

Input

Each test contains multiple test cases. The first line contains a single integer (1 \le t \le 10^4) — the number of test cases. The description of the test cases follows.

The first line of each test case contains two integers and (1 \le n \le 2 \cdot 10^5, 1 \le k \le 10^9).

The second line of each test case contains integers a_1, a_2, \ldots, a_n (0 \le a_i \le 10^9).

It is guaranteed that the sum of over all test cases does not exceed 2 \cdot 10^5.

Output

For each test case, print two integers: must use sqrt decomp

  • The minimum number of removed elements

  • The maximum length of a subarray with OR equal to after removals

If it is impossible, print "-1 -1".

Examples

Example 1

Loading
Loading

Note

In the first test case, n = 3, k = 3, a = [1, 2, 3].

  • No removals are needed. The entire array has OR 1 \mid 2 \mid 3 = 3 = k.

  • The maximum length subarray with OR is [1, 2, 3] of length . Answer: 0 3.

In the third test case, n = 4, k = 6, a = [2, 7, 4, 1].

  • Remove (1 removal). The remaining array is [2, 4, 1].

  • The subarray has OR 2 \mid 4 = 6 = k, with length . Answer: 1 2.

Scoring

  1. Subtask ( points) : No additional constraints.