#d1504. 数组划分
数组划分
Array Partition
Problem Description
Given integers, partition them into exactly subarrays. Find the maximum possible value of the bitwise AND of the sums of the subarrays.
Input Format
The first line contains two integers .
Output Format
Output one line containing the maximum possible value of the bitwise AND of the sums.
Sample Input
3 2
1 2 3
Sample Output
3
Sample Explanation
There are only two cases:
- : the answer is .
- : the answer is .
Thus the answer is .
Constraints
For of the data, and .