- Time limit: 1.00 s
- Memory limit: 512 MB
You are given an array of integers. Your task is to calculate the minimum of each window of elements, from left to right.
In this problem the input data is large and it is created using a generator.
Input
The first line contains two integers and : the number of elements and the size of the window.
The next line contains four integers , , and : the input generator parameters. The input is generated as follows:
- for
Output
Print the xor of all window minimums.
Constraints
Example
Input:
8 5 3 7 1 11
Output:
3
Explanation: The input array is . The windows are , , and , and their minimums are , , and . Thus, the answer is .