Kevin Sun wants to move his precious collection of n cowbells from Naperthrill to Exeter, where there is actually grass instead of corn. Before moving, he must pack his cowbells into k boxes of a fixed size. In order to keep his collection safe during transportation, he won't place more than two cowbells into a single box. Since Kevin wishes to minimize expenses, he is curious about the smallest size box he can use to pack his entire collection. 

Kevin is a meticulous cowbell collector and knows that the size of his i-th (1 ≤ i ≤ n) cowbell is an integer si. In fact, he keeps his cowbells sorted by size, so si - 1 ≤ si for any i > 1. Also an expert packer, Kevin can fit one or two cowbells into a box of size s if and only if the sum of their sizes does not exceed s. Given this information, help Kevin determine the smallest s for which it is possible to put all of his cowbells into k boxes of size s.

Input

The first line of the input contains two space-separated integers n and k (1 ≤ n ≤ 2·k ≤ 100 000), denoting the number of cowbells and the number of boxes, respectively.

The next line contains n space-separated integers s1, s2, ..., sn (1 ≤ s1 ≤ s2 ≤ ... ≤ sn ≤ 1 000 000), the sizes of Kevin's cowbells. It is guaranteed that the sizes si are given in non-decreasing order.

Output

Print a single integer, the smallest s for which it is possible for Kevin to put all of his cowbells into k boxes of size s.

Examples

Input

2 1
2 5


Output

7


Input

4 3
2 3 5 9


Output

9


Input

3 2
3 5 7


Output

8

Note

In the first sample, Kevin must pack his two cowbells into the same box. 

In the second sample, Kevin can pack together the following sets of cowbells: {2, 3}, {5} and {9}.

In the third sample, the optimal solution is {3, 5} and {7}.

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.Iterator;

public class Base {
	
	static Scanner scan;
	/*
	static long x;
	static long n;
	static long m;
	static int k=0;
	static long[] a;
	static int c=0;
	static int co=0;
	static long square=0;
	public static void main(String args[]){
		scan = new Scanner(System.in);
		x=scan.nextLong();
		a=new long[(int)x];
		n=x;
		m=1;
		for (n=1;n<=x;n++){
			for (m=1;m<=(int)Math.ceil((double)x/(double)n);m++){
				square= calculateNumberOfSquares(n,m);
				if (square==x){
				a[c*2]= n;
				a[c*2+1]=m;
				c++;
				}
			}
		}
		System.out.println(c);//print number of matches
		for (co=0;co<c;co++){
		System.out.println(a[co*2]+" "+a[co*2+1]);//print rest
		}
	}
	public static long calculateNumberOfSquares(long r, long c){
		long side=1;
		long squares=0;
		long store;
		if (r<c){
			store=r;
			r=c;
			c=store;
		}
		while(side <= c){
			squares=squares+(r-side+1)*(c-side+1);
			side++;
		}
		return squares;
	}*/
	/*
	static double l;
	static double w;
	static double k;
	static int squares=0;
	
	public static void main(String args[]){
		scan=new Scanner(System.in);
		l=scan.nextInt();
		w=scan.nextInt();
		k=scan.nextInt();
		
		squares=(int) (Math.floor(l/k)*Math.floor(w/k));
		System.out.println(squares);

	}
	*/
	/*
	static int n;
	static int k;
	
	static int cur=0;
	static int record=0;
	
	static int[] boxes;
	
	public static void main(String args[]){
		scan=new Scanner(System.in);
		n=scan.nextInt();
		k=scan.nextInt();
		boxes=new int[n];
		for (int c=0;c<n;c++){
			boxes[c]=scan.nextInt();
		}
		for (int c=0;c<n-k+1;c++){
			for (int d=0;d<k;d++){
			cur =cur+boxes[c+d];
			}
			if (cur>record){
				record=cur;
			}
			cur=0;
		}
		
		System.out.println(record);

	}
	*/
	/*
	static long n=0;
	static long m=0;
	static long a=0;
	static long nNeeded=0;
	static long mNeeded=0;


	public static void main(String args[]){
		scan=new Scanner(System.in);
	    n=scan.nextInt();
	    m=scan.nextInt();
	    a=scan.nextInt();

	    nNeeded=(long) Math.ceil(((double)n/(double)a));
	    mNeeded=(long) Math.ceil(((double)m/(double)a));
	    System.out.println(nNeeded*mNeeded);
		
	}*/
	/*
	static long w;
	static Boolean can=false;
	public static void main(String args[]){
		scan=new Scanner(System.in);
	    w=scan.nextInt();

	    if (w%2==0){
	    	can=true;
	    }
	    
	    if (can&&w>3){
	    System.out.println("YES");
	    }else{
	     
		    System.out.println("NO");

	    }
	    
		
	}*/
	/*
	public static void main(String args[]){
		List<Integer> l=new ArrayList<Integer>();
		Iterator<Integer> it=l.iterator();

		it.remove();
		
		l.add(0);
		l.add(1, 1);
		
		l.
	}*/
	
	/*
	static String s;
	static String t;
	static String holders;
	static String holdert;
	static int spos=0;
	static int tpos=0;
	static Boolean sChanged=false;
	static int counter=0;
	public static void main(String args[]){
		List<Integer> l= new ArrayList<Integer>();
		scan=new Scanner(System.in);
		s=scan.next();
		t=scan.next();
		
		while(spos<s.length()){
			
			if (tpos<t.length()){
			if(s.charAt(spos)==t.charAt(tpos)){
				tpos=tpos+1;
			}else{
				counter++;
				l.add(spos);

			}
			}else{
				l.add(spos);
				counter++;
				tpos=tpos+1;
			}
			spos=spos+1;
			
		}
		System.out.println(counter);
		for (int c=0;c<l.size();c++){
			System.out.print(l.get(c)+"  ");
		}
	}*/
	/*
	static int N;
	static int n1;
	static int n2;
	static int n3;
	static Boolean pos=true;
	
	public static void main(String args[]){
		scan=new Scanner(System.in);
		N=scan.nextInt();
		
		if (N%3!=0){
			pos=false;
		}
		
		n2=N/3;
		n1=n2+1;
		n3=n2-1;

		if (n3<0){
			pos=false;
		}
		
		if (pos){
			System.out.println(n1+" "+n2+" "+n3);
		}else{
			System.out.println(-1);

		}		
	}*/
	/*
	static String word;
	static String word1="";
	static String word2="";

	static int rc1=0;
	static int rc2=0;
	static int output;
	static int rem;
	static Boolean itOne=true;
	static Boolean itTwo=true;
	public static void main(String args[]){
	
		scan =new Scanner(System.in);
		word=scan.next();
		
		for (int c=0;c<word.length();c++){
			if (word.charAt(c)!=word.charAt(word.length()-1-c)){
				if(rc1==0){
				rc1=c;
				rc2=word.length()-1-c;}
			}
		}
				for (int d=0;d<word.length();d++){
					if (d!=rc1){
					word1=word1+word.charAt(d);
					}
				}
				for (int d=0;d<word.length();d++){
					if (d!=(rc2)){
					word2=word2+word.charAt(d);
					}
				}
				for (int c=0;c<word1.length();c++){
					if (word1.charAt(c)!=word1.charAt(word1.length()-1-c)){
						itOne=false;
					}
				}
				for (int d=0;d<word1.length();d++){
					if (word1.charAt(d)!=word1.charAt(word1.length()-1-d)){
						itTwo=false;
					}
				}
				if (itOne){
					System.out.println(rc1);

				}
				else if (itTwo){
					System.out.println(rc2);

				}
				else{
					System.out.println(-1);
				}
					
				
				
			
		}*/
		
	/*
	public static String word;
	public static String output;

	public static void main(String args[]){
		scan = new Scanner(System.in);
		word=scan.next();
		if (word.length()>10){
			output=word.charAt(0)+Integer.toString(word.length()-2)+word.charAt(word.length()-1);
		}else{
			output=word;
		}
		System.out.println(output);
	}*/
		/*
	public static int n;
	public static int[] a;
	public static int One=0;
	public static int numOne=0;
	public static int cur=0;
	public static int numcur=0;

	public static Boolean resetM=false;
	public static Boolean resetm=false;
	public static Boolean countOne=false;
	public static Boolean countTwo=false;
	public static Boolean resetOne=true;


	public static int store;
	public static int current=0;

	public static int record=0;

	

	public static int[] switchNum(int one, int two){

		int[] l ={two,one};
		return l;
	}

	public static void main(String args[]){
		//List<String> l= new ArrayList();
		
		scan = new Scanner(System.in);
		n=scan.nextInt();
		a=new int[n];
		a[0]=scan.nextInt();
		cur=a[0];

		numcur++;
		current=numcur;
		int temp;
		for (int c=1;c<n;c++){
			
			a[c]=scan.nextInt();
			
			if (a[c]!=cur&&a[c]!=One){
				
			}
			
			if (a[c]==cur){
				//just add 1 to numcur
			} 
			else if(a[c]==One&&resetOne==false){
				temp=cur;     cur=One;        One=temp;
				temp=numcur;  numcur=numOne;  numOne=temp;
				
			}
			else if(Math.abs(a[c]-cur)<=1){
				//switch values for cur and one
				temp=cur;     cur=a[c];        One=temp;
				temp=numcur;  numcur=0;        numOne=temp;
				resetOne=false;
				}
			else{
				One=cur;resetOne=true;numOne=numcur;
				cur=a[c];numcur=0;
				numOne=0;
			}
			numcur++;

			
			
			if (Math.abs(One-cur)<=1){countOne=true;}else{countOne=false;}
				
			current=numcur;

			if(countOne){
				current=current+numOne;
			}
			if (current>record){record=current;}
		}
		//5 4 5 5 6 7 8 8 8 7 6
		if (current>record){
			record=current;
		}
		System.out.println(record);
	}
	*/
	
	public static int n;
	public static int k;
	public static int[] s;
	public static int record;
	public static int ind=0;
	public static void main(String args[]){
		int size=0;

		scan=new Scanner(System.in);
		n=scan.nextInt();
		s=new int[n];
		k=scan.nextInt();
		if (n>k){
		ind=2*k-n;
		for(int c=0;c<n;c++){
			s[c]=scan.nextInt();
		}
		
		for(int i=0; i<k-ind;i++){
			size=s[i]+s[n-ind-1-i];
			if (size>record){
				record=size;
			}
		}
		if (ind!=0&&ind!=n){
		for(int i=k-ind; i<n;i++){
			size=s[i];
			if (size>record){
				record=size;
			}
		}}
		}else{
			for(int c=0;c<n;c++){
				s[c]=scan.nextInt();
				size=s[c];
				if (size>record){
					record=size;
				}
			}
		}
		
		System.out.println(record);
	}
}