给定一个长度为 n 的序列 a1,a2,⋯,an,请将它划分为 m 段连续的区间,设第 i 段的费用 ci 为该段内所有数字的异或和,则总费用为 $c_1 \operatorname{or} c_2 \operatorname{or} \cdots \operatorname{or} c_m$。请求出总费用的最小值。
第一行,两个整数 n,m;
第二行,n 个整数 a1,a2,⋯,an。
一行,一个整数,表示所求的值。
3 2
1 5 7
3
对于 100% 的数据,1≤m≤n≤5×105,0≤ai≤1018。