#P2099. Bit Sequence
Bit Sequence
题目描述
点击查看pdf
Let denote the number of 1s in the binary representation of .
Now MianKing has a sequence and he wants to know the number of integer satisfies that:
You need to help him calculate the answer.
输入格式
There are testcases in this problem.
The first line has one integer .
Then for each testcase, the first line has two integer . The second line has integers denote
输出格式
For each testcase, output the answer in one line.
样例
3
3 10
0 1 0
1 1000
0
9 1000000
1 0 1 1 0 1 0 0 1
2
501
41667
提示
Form 2020ICPC济南站