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).
var
  n,k,sum1,ans,i,j,z,l,r:longint;
  a,pr,d,h:array[1..200]of longint;

begin
  read(n,k);
  for i:=1 to n do
    read(a[i]);
  for i:=1 to n do
    pr[i]:=pr[i-1]+a[i];
  ans:=-1001*n;
  for l:=1 to n do
    for r:=l to n do
      begin
        for i:=1 to k do
          begin
            d[i]:=-1001;
            h[i]:=1001;
          end;
        for i:=1 to l-1 do
          for j:=k downto 1 do
            if a[i]>=d[j] then
              begin
                for z:=1 to j-1 do
                  d[z]:=d[z+1];
                d[j]:=a[i];
                break;
              end;
        for i:=r+1 to n do
          for j:=k downto 1 do
            if a[i]>=d[j] then
              begin
                for z:=1 to j-1 do
                  d[z]:=d[z+1];
                d[j]:=a[i];
                break;
              end;
        for i:=l to r do
          for j:=k downto 1 do
            if a[i]<=h[j] then
              begin
                for z:=1 to j-1 do
                  h[z]:=h[z+1];
                h[j]:=a[i];
                break;
              end; 
        sum1:=pr[r]-pr[l-1];
        for i:=1 to k do
          if (h[i]<d[i]) and (h[i]<>1001) and (d[i]<>-1001) then
            sum1:=sum1-h[i]+d[i];
        if (ans<=sum1) then ans:=sum1;
      end;
  writeln(ans);
end.