#Lutece0513. Bitwise NOT
Bitwise NOT
Migrated from Lutece 513 Bitwise NOT
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
Bitwise NOT is a kind of bit operator, we defined that as follow: for a binary base number , let , then for each bit of , we can get its value by check the digit of corresponding position in . And for each digit, , . Normally, we simply write this operator as , for example, for bits number, , .
NOT is an amazing operator and this is a problem about NOT. Give you numbers with M bits, you can choose whether do NOT opration on each number, by doing this, you should minimize the difference between maximal number and the minimal number. Calculate the minimal difference.
Input
First line of the input is a single integer (), indicates there are test cases.
For each test case, the first line is two integers () and (), the number of numbers and the bits each number has. The second line contains integers in decimal base(each number is between and ).
Output
For each case, you should output Case #k:
first, where indicates the case number between and . Then output the minimum difference.
Samples
2
2 2
1 2
2 2
1 3
Case #1: 0
Case #2: 1
Note
- For example, consider that with bits, that is , so the result is .
- Huge input,
scanf
is recommended.
Resources
elfness