SUBXOR  SubXor
A straightforward question. Given an array of positive integers you have to print the number of subarrays whose XOR is less than K. Subarrays are defined as a sequence of continuous elements A_{i}, A_{i+1}, ..., A_{j} . XOR of a subarray is defined as A_{i} ^ A_{i+1} ^ ... ^ A_{j}. Symbol ^ is Exclusive Or. You can read more about it here:
http://en.wikipedia.org/wiki/Exclusive_or
Input Format:
First line contains T, the number of test cases. Each of the test case consists of N and K in one line, followed by N space separated integers in next line.
Output Format:
For each test case, print the required answer.
Constraints:
1 ≤ T ≤ 10
1 ≤ N ≤ 10^5
1 ≤ A[i] ≤ 10^5
1 ≤ K ≤ 10^6
Sum of N over all testcases will not exceed 10^5.
Sample Input:
1 5 2 4 1 3 2 7
Sample Output:
3
Explanation:
Only subarrays satisfying the conditions are [1], [1,3,2] and [3,2].
Problem Setter: Lalit Kundu
hide comments
awesomeamul:
20200323 14:40:34
please use long long for answer


shubham97361:
20190730 23:15:36
tough to implement. 

aqua4:
20180818 12:50:25
Nice problem! Last edit: 20180818 12:56:17 

ap_222:
20180616 05:49:13
In Case if anyone needs help.


sanyam123:
20180128 16:09:18
I think there is some bug with time limits firstly same problem on codechef is getting AC(1.83 sec) with time limit of 2 seconds . Here solution with 1.54s is getting AC so what's the point of stating time limit of 1 sec. @ darkshadows 

ibrahim5253:
20171110 20:18:29
Don't forget nothing. 

Shubham Sinha:
20160625 10:37:17
make the number of bits in all the numbers that u will be processing equal which can be done by adding leading zeros for example make the number of bits in all numbers equal to 20 and then proceed, this will avoid any wrong answers. 

akhil3sh:
20160303 11:24:35
use long long for answer 

Gaurav Arora:
20160206 17:55:18
I had to use fast input using getchar_unlocked to avoid TLE


anando_du:
20150526 17:56:25
time 1 s . I got ac 1.54 s :v :v

Added by:  darkshadows 
Date:  20140126 
Time limit:  1s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: ASM64 