#D11712. Sliding Minimum Elements
Sliding Minimum Elements
Sliding Minimum Elements
For a given array of elements and an integer , find the minimum of each possible sub-arrays with size and print them from the beginning. For example, for an array and , the possible sub-arrays with size includes , , , , and the minimum of each sub-array is 1, 4, 4, 1, 1 respectively.
Constraints
Input
The input is given in the following format.
...
Output
Print a sequence of the minimum in a line. Print a space character between adjacent elements.
Example
Input
7 3 1 7 7 4 8 1 6
Output
1 4 4 1 1
inputFormat
Input
The input is given in the following format.
...
outputFormat
Output
Print a sequence of the minimum in a line. Print a space character between adjacent elements.
Example
Input
7 3 1 7 7 4 8 1 6
Output
1 4 4 1 1
样例
7 3
1 7 7 4 8 1 6
1 4 4 1 1