Problem Description

Read n integers and window size k. For each window output maximum. Use deque logic.

Input Format

First line n k. Second line n integers.

Output Format

One line of maxima.

Sample Test Case

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

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next