Suki's Treat Window Maximum
Suki loves her daily walks through the park, and today she's discovered a delightful row of treat piles! As she walks past them, her vision spans exactly k consecutive piles at any moment. She wants to know the maximum pile size she can see at each position during her walk.
More formally, given an array of n treat pile sizes, compute the maximum value in every contiguous subarray of length k, for all starting positions where a full window fits.
Input
The first line contains two integers n and k (1 ≤ k ≤ n ≤ 2·10^5).
The second line contains n integers a_1, a_2, ..., a_n (1 ≤ a_i ≤ 10^9), the sizes of the treat piles.
Output
Print n - k + 1 integers: the maximum pile size in Suki's window at each position. Print one integer per line.
Notes
The first window starts at position 0 and includes piles 0 through k-1. The second window starts at position 1 and includes piles 1 through k. And so on.