Problem Description

Given n numbers and window size k, print the maximum for each window.

Input Format

Line1: n k. Line2: n integers.

Output Format

n-k+1 integers space separated.

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