You have an array of length . You have to divide the array into atmost consecutive segments such that the maximum bitwise OR of these segments is minimum.
Find the minimum possible maximum Bitwise OR of these segments if you divide optimally.
Input Format:
Output Format:
For each test case, print the minimum possible maximum Bitwise OR of these segments if you divide optimally.
Constraints:
First test case:
We can divide into . Bitwise OR of these segments is . Hence, the answer is , which is the minimum possible.
Second test case:
We can divide into and . Bitwise OR of these segments is . Hence, the answer is , which is the minimum possible.