Monica , Joey and the Date punishment
/
No tags
Problem
Editorial
Analytics

Monica, Joey and the Date punishment

This time the quarrel is between Joey and Monica, and the the quarrel is rather unique in itself. Both had decided to bring each other a date for Saturday night, but Joey, due to his carelessness forgot and therefore Monica was alone , again.

Now Monica is angry with Joey and decides to punish him. But after looking at Joey's cute face, she decides to give him a final chance. She gave him a set a numbers A[i] , and now she wants Joey to find out how many subsets of the following set have xor value less than or equal to her Lucky Number L.

But Joey is unfortunately dumb and therefore seeks your help. You should do this problem quickly, before Monica finds out that Joey is bailing on the problem.

Input:

T - No of test cases
N - No of elements in array
A line containing N space seperated integers A[i]
L - Her lucky number

Output:

The answer of the query as stated in the problem.

Constraints:

$1 \leq T \leq 10$

$1 \leq N \leq 20$

$1 \leq A[i],L \leq 100$

Problem Setter - Satyarth

SAMPLE INPUT
1
4
1 2 3 4
3
SAMPLE OUTPUT
8
Time Limit: 1.0 sec(s) for each input file.
Memory Limit: 256 MB
Source Limit: 1024 KB