#### Registered Users Only

Please login to utilize this feature.

Do note that this website only supports submissions in C++.

## Problem Description

Bradley the Unicorn wants to get to sugar candy mountain. (to meet Charlie the Unicorn). However, the route to sugar candy mountain is unforunately littered with lots of lots of, you guess what? CANDY!

The route to sugar candy mountain brings Bradley to a river with *N* pebbles arranged in a straight line. To cross the river, Bradley can jump from pebbles to pebbles. He can jump up to *K* pebbles ahead at one time.

"Too much sugar will make me have diabetes!" -- says Bradley. Therefore, Bradley wants to travel on a route where by the maximum number of candies per pebble is reduced.

It is assumed that he can jump from the his starting shore to the first *K* pebbles and he can jump from any of the last *K* pebbles to the other shore.

## Input

The first line of input consists of 2 integers, *N* followed by *K*.

The second line of input will consist of *N* integers. The *i ^{th}* integer represents the number of sweets on the

*i*pebble.

^{th}## Output

Output a single integer. The integer should represent the maximum number of candies per pebble that Bradley will encounter if he takes the route where the maximum number of candies per pebble is reduced.

(i.e. Find therout e where the maximum number of candies encountered in a pebble on the route is reduced, and output that number)

## Limits

The number of candies on each pebble will be a non-negative integer that fits into a 32-bit signed integer.

Subtask 1 (25%): 0 < *N* ≤ 100

Subtask 2 (25%): 0 < *N* ≤ 1000

Subtask 3 (50%): 0 < *N* ≤ 100000

## Sample Input 1

10 4 1 2 3 4 5 6 7 8 9 10

## Sample Output 1

7

The route is start -> 1 -> 5 -> 7 -> end

## Sample Input 2

10 3 0 1 3 2 4 8 2 7 3 5

## Sample Output 2

3

The route is start -> 0 -> 2 -> 2 -> 3 -> end

### Tags

### Subtasks and Limits

Subtask | Score | #TC | Time | Memory | Scoring |
---|---|---|---|---|---|

1 | 25 | 15 | 0.5s | 32MB | Minimum |

2 | 25 | 15 | 0.5s | 32MB | Minimum |

3 | 50 | 15 | 0.5s | 32MB | Minimum |

4 | 0 | 2 | 0.5s | 32MB | Minimum |

### Judge Compile Command

g++ ans.cpp -o candymountain_ex -Wall -static -O2 -lm -m64 -s -w -std=gnu++14 -fmax-errors=512