#### Registered Users Only

Please login to utilize this feature.

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

## Problem Description

A group of peanuts live in a one-dimensional world. To celebrate the commencement of a new peanut civilisation, they have decided to organise a party! However, there is a problem. There are tons and tons of strawberries sprouting all over the one-dimensional world, and peanuts for some reason hate strawberries!

The one-dimesional world is split up into *N* segments. Each segment of land will have a certain number of strawberries growing on it. The party area would span a length of *L* such segments. The peanuts want to pick a section of *L* consecutive segments to hold their party such that the number of strawberries on that section is minimised. Help the peanuts calculate the minimum number of strawberries that are growing on their party land.

Your program is required to implement the following functions:

*int minStrawberries(int N, int L, int A[])*, where*A[]*is an array containing the number of strawberries growing on each segment.

## Limits

For all subtasks:*L*<=

*N*,

*A*<= 1 000

_{i}Subtask 1 (37%): 1 <=

*N*<= 1 000

Subtask 2 (63%): 1 <=

*N*<= 1 000 000

## Sample Input 1

5 3 2 3 1 4 5

## Sample Output 1

6

## Explanation for Sample 1

The section of length 3 that contains the least number of strawberries among [2, 3, 1, 4, 5] is [2, 3, 1], containing 6 strawberries.### Tags

### Subtasks and Limits

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

1 | 37 | 51 | 1s | 32MB | Minimum |

2 | 63 | 51 | 1s | 32MB | Minimum |

3 | 0 | 1 | 1s | 32MB | Minimum |

### Judge Compile Command

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