#Lutece0825. A Bit Fun

A Bit Fun

Migrated from Lutece 825 A Bit Fun

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

There are nn numbers in a array, as a0,a1,an1a_{0},a_{1}\cdots ,a_{n-1}, and another number mm. We define a function f(i,j)=aiai+1ai+2ajf(i,j)=a_{i}|a_{i+1}|a_{i+2}|\cdots |a_{j}. Where | is the bit-OR operation. (iji\leq j)

The problem is really simple: please count the number of different pairs of (i,ji,j) where f(i,j)<mf(i,j)<m.

Input

The first line has a number TT (T50T\leq 50) , indicating the number of test cases.

For each test case, first line contains two numbers nn and mm.(1n100000,1m2301\leq n\leq 100000, 1\leq m\leq 2^{30}) Then nn numbers come in the second line which is the array a, where 1ai2301\leq a_{i}\leq 2^{30}.

Output

For every case, you should output Case #t: at first, without quotes. The tt is the case number starting from 11.

Then follows the answer.

Samples

2
3 6
1 3 5
2 4
5 4
Case #1: 4
Case #2: 0

Resources

2013 ACM/ICPC Asia Regional Chengdu Online