You are given an array a_1, a_2, ..., a_n and an integer k.

You are asked to divide this array into k non-empty consecutive subarrays. Every element in the array should be included in exactly one subarray. Let f(i) be the index of subarray the i-th element belongs to. Subarrays are numbered from left to right and from 1 to k.

Let the cost of division be equal to ∑_{i=1}^{n} (a_i ⋅ f(i)). For example, if a = [1, -2, -3, 4, -5, 6, -7] and we divide it into 3 subbarays in the following way: [1, -2, -3], [4, -5], [6, -7], then the cost of division is equal to 1 ⋅ 1 - 2 ⋅ 1 - 3 ⋅ 1 + 4 ⋅ 2 - 5 ⋅ 2 + 6 ⋅ 3 - 7 ⋅ 3 = -9.

Calculate the maximum cost you can obtain by dividing the array a into k non-empty consecutive subarrays. 

Input

The first line contains two integers n and k (1 ≤ k ≤ n ≤ 3 ⋅ 10^5).

The second line contains n integers a_1, a_2, ..., a_n ( |a_i| ≤ 10^6). 

Output

Print the maximum cost you can obtain by dividing the array a into k nonempty consecutive subarrays. 

Examples

Input


5 2
-1 -2 5 -4 8


Output


15


Input


7 6
-3 0 -1 -2 -2 -4 -1


Output


-45


Input


4 1
3 -1 6 0


Output


8
import java.util.*;
import java.math.*;

// **** D. Array Splitting ****

public class D {
	static char [] in = new char [1000000];
	public static void main (String [] arg) throws Throwable {
		int n = nextInt();
		int k = nextInt();
		long [] a = new long [n];
		long [] sum = new long [n];
		PriorityQueue<Pair> Q = new PriorityQueue<Pair>();
		for (int i = 0; i<n; ++i) {
			a[i] = nextLong();
			sum[i] = (i == 0) ? a[i] : sum[i-1] + a[i];
			if (i <= n-k) Q.add( new Pair(i, i, sum[i]) );
		}
		
		long cost = 0;
		long prev_sum = 0;
		int prev_sum_pos = -1;
		
		while (!Q.isEmpty() && k > 1) {
			Pair P = Q.poll();
			//if (P.x <= prev_sum_pos) continue;
			
			cost += (sum[n-1] - prev_sum);
			//System.err.println("Sub Array : " + (prev_sum_pos+1) + " - " + P.x + " c: " + cost);
			prev_sum_pos = P.x;
			prev_sum = P.L;
			
			k--;
			Q.add(new Pair(n-k, n-k, sum[n-k]));
		}
		//if (k != 1) sum[-1] = 0;
		cost += (sum[n-1] - prev_sum);
		//System.err.println("Sub Array : " + (prev_sum_pos+1) + " - " + (n) + " c: " + cost);
		System.out.println(cost);
	}

	
	
	
	
	
	
	
	
	
	
	
	
	
	/************** HELPER CLASSES ***************/
    static class HS extends HashSet<Integer>{public HS(){super();}public HS(int a){super(a);}};
	static class AL extends ArrayList<Integer>{public AL(){super();}public AL(int a){super (a);}};
	static class Pair implements Comparable<Pair> {int x,y;long L; public Pair(int xx, int yy, long LL){x=xx;y=yy;L=LL;} public int compareTo(Pair p) {
		return (this.L < p.L) ? -1 : ((this.L == p.L && this.x < p.x) ? -1 : 1);}
	}	
	
	/************** FAST IO CODE FOLLOWS *****************/
	public static long nextLong() throws Throwable {
		long i = System.in.read();boolean neg = false;while (i < 33) i = System.in.read();if (i == 45) {neg=true;i=48;}i = i - 48;
		int j = System.in.read();while (j > 32) {i*=10;i+=j-48;j = System.in.read();}return (neg) ? -i : i;
	}
	public static int nextInt() throws Throwable {return (int)nextLong();}
	public static String next() throws Throwable {
		int i = 0; while (i < 33 && i != -1) i = System.in.read(); int cptr = 0; while (i >= 33) { in[cptr++] = (char)i; i = System.in.read();}
		return new String(in, 0,cptr);
	}
	/**** LIBRARIES ****/
	public static long gcdL(long a, long b) {while (b != 0) {long tmp = b;b = (a % b);a = tmp;}return a;}
	public static int gcd(int a, int b) {while (b != 0) {int tmp = b;b = (a % b);a = tmp;}return a;}
	public static int[] sieve(int LIM) {
		int i,count = 0;
		boolean [] b = new boolean [LIM];
		for (i = 2;i<LIM; ++i) if (!b[i]) {count++; for (int j = i<<1; j<LIM; j+=i) b[j] = true;}
		int [] primes = new int[count];
		for (i = 2,count=0;i<LIM;++i) if (!b[i]) primes[count++] = i;
		return primes;
	}
	public static int[] numPrimeFactors(int LIM) {
		int i,count = 0;
		int [] b = new int [LIM];
		for (i = 2;i<LIM; ++i) if (b[i] == 0) {count++; for (int j = i; j<LIM; j+=i) b[j]++;}
		return b;
	}
	public static StringBuilder stringFromArray(int [] a) {
		StringBuilder b = new StringBuilder(9*a.length);
		for (int i = 0; i<a.length; ++i) {
			if (i != 0) b = b.append(' ');
			b = b.append(a[i]);
		}
		return b;
	}
}

/* Full Problem Text:
  
You are given an array a_1, a_2, \dots, a_n and an integer k.
You are asked to divide this array into k non-empty consecutive subarrays.
Every element in the array should be included in exactly one subarray.
Let f(i) be the index of subarray the i-th element belongs to.
Subarrays are numbered from left to right and from 1 to k.
Let the cost of division be equal to \sum\limits_{i=1}^{n} (a_i \cdot f(i)).
For example, if a = [1, -2, -3, 4, -5, 6, -7] and we divide it into 3 subbarays in the following way: [1, -2, -3], [4, -5], [6, -7], then the cost of division is equal to 1 \cdot 1 - 2 \cdot 1 - 3 \cdot 1 + 4 \cdot 2 - 5 \cdot 2 + 6 \cdot 3 - 7 \cdot 3 = -9.
Calculate the maximum cost you can obtain by dividing the array a into k non-empty consecutive subarrays.


 */