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

    u = 0
    while u<k:
        e = min(a[si:ei+1])
        if e < 0:
            w = 0
            for yy in range(n):
                if a[yy]==e and yy>=si:
                    w = yy
                    break
            a[w], a[si] = a[si], a[w]
            u+=1

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

    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()