#Q179. 「一本通 5.5 例 3」修剪草坪

「一本通 5.5 例 3」修剪草坪

Description

Original Source: USACO 2011 Open Gold

After winning the town's best lawn competition a year ago, FJ became lazy and has not mowed the lawn since. Now, a new round of the best lawn competition has begun, and FJ hopes to win the championship again.

However, FJ's lawn is very messy, so he can only rely on his cows to do the job. FJ has NN cows lined up in a row, numbered from 11 to NN. Each cow has a different efficiency, with cow ii having an efficiency of EiE_i.

Cows that are close to each other are familiar. If FJ assigns more than KK consecutive cows, these cows will go on strike and throw a party. Therefore, FJ now needs your help to calculate the maximum efficiency he can obtain without selecting more than KK consecutive cows in any arrangement.

Input Format

The first line contains two space-separated integers NN and KK;

The second to the (N+1)(N+1)-th lines each contain an integer EiE_i.

Output Format

A single line with the maximum efficiency value FJ can obtain.

Sample 1

FJ has 55 cows with efficiencies 1,2,3,4,51, 2, 3, 4, 5. He wants to select the cows with the maximum total efficiency but cannot choose more than 22 consecutive cows. FJ selects all cows except the third one, resulting in a total efficiency of 1+2+4+5=121 + 2 + 4 + 5 = 12.

5 2
1
2
3
4
5

12

Constraints & Hints

For all data, 1N105,0Ei1091\le N\le 10^5, 0\le E_i\le 10^9.