#Lutece0583. function

function

Migrated from Lutece 583 function

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

Given a set of nn integers: num={num1,num2,,numn}num=\{num_1,num_2,\cdots ,num_n\} and an integer mm.

we define a function AA(num,m)AA(num,m) as below:

$AA(num,m)=\{[l,r]\mid (l\leq r)\ and\ (num_l\ xor\ num_{l+1}\cdots\ xor\ num_{r})\leq m \}$

Your task is to calculate the number of element of AA(num,m)AA(num,m).

Input

The first line contains the number of test cases.

For every test,the input consists of two lines.

The first line contains two integers nn and mm.

There are nn integers in the second line.

limit: 1n1051\leq n\leq 10^5, 0numi0\leq num_i, m<231m<2^{31};

Output

For each test case just output one integer in one line.

Samples

2
2 3
1 4
2 3
4 5
1
1

Resources

Sichuan University Programming Contest