As usual, Sereja has array *a*, its elements are integers: *a*[1], *a*[2], ..., *a*[*n*]. Let's introduce notation:

A swap operation is the following sequence of actions:
 -  choose two indexes *i*, *j* (*i* ≠ *j*); -  perform assignments *tmp* = *a*[*i*], *a*[*i*] = *a*[*j*], *a*[*j*] = *tmp*. 
What maximum value of function *m*(*a*) can Sereja get if he is allowed to perform at most *k* swap operations?
The first line contains two integers *n* and *k* (1 ≤ *n* ≤ 200; 1 ≤ *k* ≤ 10). The next line contains *n* integers *a*[1], *a*[2], ..., *a*[*n*] ( - 1000 ≤ *a*[*i*] ≤ 1000).
class Triple:
    start = 0
    end = 0
    _sum = 0
    swapIndex = 0

def calculateSum(arr, start, negAllowed):
    tpl = Triple()
    tpl.start = start
    tpl._sum = arr[start]
    for index in range(start + 1, len(arr)):
        if arr[index] >= 0:
            tpl._sum += arr[index]
            tpl.end = index
        elif negAllowed:
            tpl.swapIndex = index
            negAllowed = False
            continue
        else:
            break
    return tpl


def findMaxSum(arr, negAllowed):
    maxSum = None
    for index in range(0, len(arr)):
        tmpSum = calculateSum(arr, index, negAllowed)
        maxSum = tmpSum if maxSum is None or tmpSum._sum > maxSum._sum else maxSum
    return maxSum


n, k = map(int, input().split())
elements = list(map(int, input().split()))
for i in range(0, k):
    triple = findMaxSum(elements, True)
    maxItemIndex = None
    for j in list(range(0, triple.start)) + list(range(triple.end + 1, len(elements))):
        if maxItemIndex is None or elements[j] > elements[maxItemIndex]:
            maxItemIndex = j

    if maxItemIndex is not None:
        tmp = elements[triple.swapIndex]
        elements[triple.swapIndex] = elements[maxItemIndex]
        elements[maxItemIndex] = tmp

triple = findMaxSum(elements, False)
print(triple._sum)
