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 bisect import bisect_left, bisect_right

n, k = map(int, input().split())
t = list(map(int, input().split()))
p = sorted(t)

if p[-1] <= 0:
    print(p[-1])
    exit(0)
if p[0] >= 0:
    print(sum(p))
    exit(0)
i = max(0, n - k - 1)
while p[i] < 0: i += 1
q = sum(p[i: ])
if n < k + 2 or p[n - k - 1] <= 0:
    print(q)
    exit(0)

for l in range(n - k - 2):
    r = l + k + 2
    u = sorted(t[: l] + t[r: ])
    v = sorted(t[l: r])
    for i in range(r, n):
        q = max(q, sum(sorted(v + u[- min(k, len(u)): ])[- len(v): ]))
        u.remove(t[i])
        v.insert(bisect_left(v, t[i]), t[i])
    q = max(q, sum(sorted(v + u[- min(k, len(u)): ])[- len(v): ]))
print(q)