eolymp
bolt
Try our new interface for solving problems
Problems

Guitar Hero

Guitar Hero

Recently Vasya bought himself an exciting game "Guitar Hero", in which all comers are invited to try themselves in the role of a rock guitarist. In order to pass it, you need to pinch certain buttons combinations every second (which, fortunately, a little). If the necessary buttons are clamped, then it is considered that the player played the right note. In this case, he is awarded a certain number of points (for each note number of points is different, and for some notes the points are removed). Otherwise, an unpleasant sound is heard, and no points are awarded.

At the first and second level of difficulty, Vasya played everything easily. However, having moved to the third level, he faced the fact that he can not perform one particularly intricate composition. After several unsuccessful attempts, Vasya suddenly noticed that he could correctly play any segment of k or less notes, regardless of their complexity. On the other hand, he does not succeed in correctly executing k + 1 notes in a row, even if they are very simple. Since Vasya is not a psychologist, he could not understand why this is happening. But after a short search on the Internet, he found a detailed description of how many points are charged for each correctly played note. Using this, he wants to determine what maximum number of points he can get. Help Vasya.

Input

First line contains two integers n and k (1n10000, 1k1000), where n is the number of notes in composition. Second line contains n integers - the number of points received for the notes played. All numbers do not exceed 109 by absolute value.

Output

Print one number - the maximum number of points that Vasya can get.

Time limit 1 second
Memory limit 128 MiB
Input example #1
5 2
2 3 1 4 5
Output example #1
14
Input example #2
5 1
2 3 1 4 5
Output example #2
8
Input example #3
5 2
2 3 1 -4 5
Output example #3
10
Source 2009 Цикл интернет-олимпиад для школьников. Седьмая индивидуальная олимпиада, January 10, Problem A