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

from collections import Counter
from math import cos, e
import bisect as bs
from math import *
mod=1000000007

def pro(arr,m):
    n=len(arr)
    ans=-inf
    for i in range(n):
        for j in range(i,n):
            aout,ain=[],[]
            for k in range(n):
                if(k<i or j<k):
                    aout.append(arr[k])
                else:
                    ain.append(arr[k])
            aout.sort(reverse=True)
            
            for k in range(min(m,len(aout))):
                if(aout[k]>=0):
                    ain.append(aout[k])
            print(ain,aout,sum(ain))
            ans=max(ans,sum(ain))
    #print(ans)

t=1
for i in range(t):
    n,k=list(map(int,input().split()))
    arr=list(map(int,input().split()))
    pro(arr,k)