#Lutece0584. CBS number
CBS number
Migrated from Lutece 584 CBS number
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
You are given numbers. We define as CBS number if the binary sequence of contains the binary sequence of any other numbers in these numbers.
Now can you tell me how many CBS numbers in the range of .
Input
The first line contains a single integer (),the number of test cases.
In each test case, its first line contains a number ().
In each of next lines contains a number ().
The last line of each case contains two number ().
Output
Please calculate how many CBS numbers in the range of .
Samples
1
1
3
1 100
67
Resources
Sichuan University Programming Contest