#15857. [SNCPC2019] Coolbits
[SNCPC2019] Coolbits
[SNCPC2019] Coolbits
题目描述
Given $n$ intervals $[l_1, r_1], [l_2, r_2], \dots, [l_n, r_n]$, one must select an integer from each of the intervals and calculate their bitwise and value $b$. What's the maximum possible $b$ one can get?输入格式
There are multiple test cases. The first line of the input contains an integer $T$, indicating the number of test cases. For each test case:The first line contains an integer (), indicating the number of intervals.
For the following lines, the -th line contains two integers and (), indicating the -th interval.
It's guaranteed that the sum of of all test cases will not exceed .
输出格式
For each test case output one line containing one integer, indicating the maximum possible $b$ one can get.2
3
0 8
2 6
3 9
1
1 100
6
100