#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 integers: and an integer .
we define a function 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 .
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 and .
There are integers in the second line.
limit: , , ;
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