Limits 500ms, 256 MB

You have an array of size N which contains positive integers. You can apply the following operation on the array.

  • You select an index i (1 ≤ i < size_of_current_array).
  • Apply A[i + 1] = A[i + 1] XOR A[i].
  • Remove the i'th element from the array.

You have to apply this operation exactly K times on the array. Finally, you will get an array of size (N - K). You have to minimize the maximum element of the final array.

Input

The first line contains two integers N (2 ≤ N ≤ 50000) and K (1 ≤ K < min(51,N)).

The next line contains N integers Ai (1 ≤ Ai ≤ 109), denoting the elements of the array.

Output

Print the answer in a single line.

Sample

InputOutput
3 1
1 2 3
1

If we pick i = 1, we will get [1, 3, 3]. After removal of first element the array will become [3, 3]. Maximum element is 3.

If we pick i = 2, we will get [1, 2, 1]. After removal of second element the array will become [1, 1]. Maximum element is 1.

So, the answer is 1.


Submit

Login to submit.

Statistics

48% Solution Ratio
tmwilliamlin168Earliest, Feb '20
Shubham.436400Fastest, 0.0s
Andres_UntLightest, 10 MB
Kuddus.6068Shortest, 492B
Toph uses cookies. By continuing you agree to our Cookie Policy.