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

# -*- coding: utf-8 -*-
"""
Created on Tue Mar 16 19:26:32 2021

@author: Admin
"""

def maxSubArraySum(a,size):
	
	max_so_far = 0
	max_ending_here = 0
	
	for i in range(0, size):
		max_ending_here = max_ending_here + a[i]
		if max_ending_here < 0:
			max_ending_here = 0
		
		# Do not compare for all elements. Compare only 
		# when max_ending_here > 0
		elif (max_so_far < max_ending_here):
			max_so_far = max_ending_here
			
	return max_so_far

n,k=map(int,input().split())
l=[int(i) for i in input().split()]
pos=0
neg=0
for i in range(len(l)):
    if l[i]>0:
        pos+=1
    else:
        neg+=1
        
        
#print(pos,neg)
while k:
    maxi=0
    maxind=0
    mini=100000
    minind=0
    for i in range(neg):
        if l[i]>maxi:
            maxi=l[i]
            maxind=i
    for i in range(neg,len(l)):
        if l[i]<mini:
            mini=l[i]
            minind=i
    l[maxind],l[minind]=l[minind],l[maxind]
    #print(l)
    k-=1
    for p in range(len(l)):
        if l[p]>0:
            break
    if p==neg:
        break

if maxSubArraySum(l, len(l))==0:
    if 0 in l:
        print(0)
    else:
        print(max(l))
else:
    print(maxSubArraySum(l, len(l)))