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).
#!/usr/bin/python
import re
import inspect
from sys import argv, exit
from copy import copy

def rstr():
    return input()

def rint():
    return int(input())

def rints(splitchar=' '):
    return [int(i) for i in input().split(splitchar)]

def varnames(obj, namespace=globals()):
    return [name for name in namespace if namespace[name] is obj]

def pvar(var, override=False):
    prnt(varnames(var), var)

def prnt(*args, override=False):
    if '-v' in argv or override:
        print(*args)

def compress(nums):
    a = []
    t = 0
    num = 0
    for i, n in enumerate(nums):
        if n > 0:
            num += 1
            t += n
        else:
            if t:
                a.append((t, num))
            a.append((n, 1))
            num = 0
            t = 0
    if t:
        a.append((t, num))
    return a

def get_swapped(arr, i, j):
    arr = copy(arr)
    x = arr[i]
    arr[i] = arr[j]
    arr[j] = x
    return arr

def get_all_maxes(arr):
    m = None
    for i in range(len(arr)+1):
        for j in range(len(arr)+1):
            if i>=j:
                continue
            mx = sum(arr[i:j])
            if m is None or mx > m:
                m = sum(arr[i:j])
    return m

def do_all_swaps(arr, k, i=0, j=0):
    if k == 0: 
        return get_all_maxes(arr)
    m = get_all_maxes(arr)
    for i in range(i,len(arr)):
        for j in range(j,len(arr)):
            if i >= j:
                continue
            else:
                swapped = get_swapped(arr, i, j)
                swapmax = do_all_swaps(swapped, k-1, i, j)
                if swapmax is None:
                    continue
                else:
                    m = max(m, swapmax)
    return m
        

if __name__ == '__main__':
    n, swaps = rints()
    nums = rints()
    
    print(do_all_swaps(nums, swaps))
