#P8019. [ONTAK2015] OR-XOR
[ONTAK2015] OR-XOR
Problem Description
Given a sequence of length , split it into consecutive segments. Let the cost of the -th segment be , which is the XOR sum of all numbers in that segment. Then the total cost is $c_1 \operatorname{or} c_2 \operatorname{or} \cdots \operatorname{or} c_m$. Find the minimum possible total cost.
Input Format
The first line contains two integers .
The second line contains integers .
Output Format
Output one line containing one integer, which is the required value.
3 2
1 5 7
3
Hint
For of the testdata, , .
Translated by ChatGPT 5