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).
__author__ = 'Lipen'

def main():
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    si = -1
    ei = -1
    for i in range(n):
        if a[i]>=0:
            si = i
            break
    for i in range(n-1, -1, -1):
        if a[i]>=0:
            ei = i
            break

    if si==-1:
        print(max(a))
        return

    c = 0
    negatedata = []
    for i in range(si, ei+1):
        if a[i]<0:
            c+=1
            negatedata.append([a[i], i])

    negatedata = sorted(negatedata, key=lambda x: x[0])

    for z in range(min(c, k)):
        v = negatedata[z][1]
        a[si], a[v] = a[v], a[si]
        si+=1

    m = -300000
    b = True
    for i in range(si, ei+1):
        for j in range(i, ei+1):
            temp = sum(a[i:j+1])
            if b:
                m = temp
                b = False
            elif temp>m:
                m = temp

    print(m)

main()