Problem Description

Given array and window size k, print the maximum in each window.

Input Format

Line1 n k. Line2 n ints.

Output Format

One line n-k+1 ints.

Sample Test Case

Input:
8 3 1 3 -1 -3 5 3 6 7
Output:
3 3 5 5 6 7

Constraints

n

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next