Mirko's newest math homework assignment is a very difficult one! Given a sequence,
Input Specification
The first line of input contains two positive integers,
The second line of input contains
Output Specification
The first and only line of output must contain the smallest possible sum
Sample Input 1
Copy
5 2
-3 -2 3 8 6
Sample Output 1
Copy
7
Sample Input 2
Copy
6 2
-5 8 10 1 13 -1
Sample Output 2
Copy
13
Sample Input 3
Copy
6 3
10 2 8 17 2 17
Sample Output 3
Copy
6
Comments