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.io.*;
import java.util.*;

public class D implements Runnable {
	public static void main (String[] args) {new Thread(null, new D(), "_cf", 1 << 28).start();}
	
	public void run() {
//		try { new TestGen(); } catch (Exception e) {}
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");
//		try { fs = new FastScanner("testdata.out"); } catch (Exception e) {}

		int n = fs.nextInt();
		int k = fs.nextInt();
		int[] a = fs.nextIntArray(n);
		long[][] pref = new long[n][2];
		for(int i = 0; i < n; i++) {
			pref[i][0] += a[i];
			if(i > 0) pref[i][0] += pref[i-1][0];
			pref[i][1] = i;
		}
		Arrays.sort(pref, (x, y) -> Long.compare(x[0], y[0]));
		boolean[] split = new boolean[n];
		int cnt = 0;
		for(int i = 0; cnt < k-1; i++) {
			if(pref[i][1] == n-1) continue;
			cnt++;
			split[(int)pref[i][1]] = true; 
		}
		
		long res = 0;
		long idx = 1;
		for(int i = 0; i < n; i++) {
			res += a[i]*idx;
			if(split[i]) idx++;
		}
		out.println(res);
		
		out.close();
	}
	
	long[][] dp;
	long brute(int[] a, int n, int k) {
		dp = new long[k+1][n];
		for(long[] d : dp) Arrays.fill(d, -1);
		return solve(a, 0, k, k);
	}
	
	long oo = (long)1e18;
	long solve(int[] a, int n, int k, int ok) {
		if(n == a.length) {
			return k > 0 ? -oo : 0;
		}
		if(k <= 0) return -oo;
		long ret = dp[k][n];
		if(ret != -1) return ret;
		long idx = ok - k + 1;
		long sum = 0;
		long res = -oo;
		for(int to = n; to < a.length; to++) {
			sum += a[to] * idx;
			ret = solve(a, to+1, k-1, ok);
			if(ret == -oo) continue;
			ret += sum;
			if(ret == 216) System.out.println("!!! " + to);
			res = Math.max(res, ret);
		}
		return dp[k][n] = res;
	}
	
	class RMQ {
		long[] vs;
		long[][] lift;
		int[][] idx;

		public RMQ(long[] vs) {
			this.vs = vs;
			int n = vs.length;
			int maxlog = Integer.numberOfTrailingZeros(Integer.highestOneBit(n)) + 2;
			lift = new long[maxlog][n];
			idx = new int[maxlog][n];
			for (int i = 0; i < n; i++) {
				lift[0][i] = vs[i];
				idx[0][i] = i;
			}
			int lastRange = 1;
			for (int lg = 1; lg < maxlog; lg++) {
				for (int i = 0; i < n; i++) {
					long v1 = lift[lg - 1][i];
					long v2 = lift[lg - 1][Math.min(i + lastRange, n - 1)];
					if(v1 > v2) {
						lift[lg][i] = v1;
						idx[lg][i] = idx[lg-1][i];
					}
					else {
						lift[lg][i] = v2;
						idx[lg][i] = idx[lg-1][Math.min(i + lastRange, n - 1)];	
					}
				}
				lastRange *= 2;
			}
		}

		public int query(int low, int hi) {
			int range = hi - low + 1;
			int exp = Integer.highestOneBit(range);
			int lg = Integer.numberOfTrailingZeros(exp);
			if(lift[lg][low] > lift[lg][hi-exp+1]) {
				return idx[lg][low];
			}
			else {
				return idx[lg][hi - exp + 1];
			}
//			return Math.min(lift[lg][low], lift[lg][hi - exp + 1]);
		}
	}
	
	class FastScanner {
		public int BS = 1<<16;
		public char NC = (char)0;
		byte[] buf = new byte[BS];
		int bId = 0, size = 0;
		char c = NC;
		double num = 1;
		BufferedInputStream in;

		public FastScanner() {
			in = new BufferedInputStream(System.in, BS);
		}

		public FastScanner(String s) throws FileNotFoundException {
			in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
		}

		public char nextChar(){
			while(bId==size) {
				try {
					size = in.read(buf);
				}catch(Exception e) {
					return NC;
				}                
				if(size==-1)return NC;
				bId=0;
			}
			return (char)buf[bId++];
		}

		public int nextInt() {
			return (int)nextLong();
		}

		public long nextLong() {
			num=1;
			boolean neg = false;
			if(c==NC)c=nextChar();
			for(;(c<'0' || c>'9'); c = nextChar()) {
				if(c=='-')neg=true;
			}
			long res = 0;
			for(; c>='0' && c <='9'; c=nextChar()) {
				res = (res<<3)+(res<<1)+c-'0';
				num*=10;
			}
			return neg?-res:res;
		}

		public double nextDouble() {
			double cur = nextLong();
			return c!='.' ? cur:cur+nextLong()/num;
		}

		public String next() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c>32) {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public String nextLine() {
			StringBuilder res = new StringBuilder();
			while(c<=32)c=nextChar();
			while(c!='\n') {
				res.append(c);
				c=nextChar();
			}
			return res.toString();
		}

		public boolean hasNext() {
			if(c>32)return true;
			while(true) {
				c=nextChar();
				if(c==NC)return false;
				else if(c>32)return true;
			}
		}
		
		public int[] nextIntArray(int n) {
			int[] res = new int[n];
			for(int i = 0; i < n; i++) {
				res[i] = nextInt();
			}
			return res;
		}
		
	}

	
}