XOr
시간 제한1초메모리 제한1024 MB
수열을 정확히 m개의 연속한 부분으로 나눌 때, 각 부분의 XOR 합들을 모두 OR한 값이 최소가 되도록 한다.
문제
bobo has a sequence of integers . He decides to divide the sequence into exactly consecutive parts.
The cost of each part is its xor sum (bitwise exclusive-or), while the cost of division is bitwise or-sum of its parts' costs.
Help bobo find the minimum cost.
입력
The first line contains integers ().
The second line contains integers ().
출력
A single integer denotes the minimum cost.