#Lutece1471. Alice and Bob are playing number
Alice and Bob are playing number
Migrated from Lutece 1471 Alice and Bob are playing 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
-Bob and his girl friend are playing game together.This game is like this:
There are numbers.
If op = ,Bob wants to find two numbers and ,that & will become maximum value.
If op = ,Bob wants to find two numbers and ,that ^ will become maximum value.
If op = ,Bob wants to find two numbers and ,that | will become maximum value.
Notice:
& for bitwise AND. (4 & 2) is 0, (4 & 5) is 4.
^ for bitwise XOR. (4 ^ 2) is 6, (4 ^ 5) is 1.
| for bitwise OR . (4 | 2) is 6, (4 | 5) is 5.
Input
-First line is a positive integer , represents there are test cases.
For each test case:
First line includes two numbers .
The next line contains numbers: .
Output
-For the -th test case , first output Case #i: in a single line.
Then output the answer of -th test case.
Samples
3
2 1
4 2
2 2
4 2
2 3
4 2
Case #1: 0
Case #2: 6
Case #3: 6
Resources
“玲珑杯”ACM比赛 Round #2