There are some rabbits in Singapore Zoo. To feed them, Zookeeper bought n carrots with lengths a_1, a_2, a_3, …, a_n. However, rabbits are very fertile and multiply very quickly. Zookeeper now has k rabbits and does not have enough carrots to feed all of them. To solve this problem, Zookeeper decided to cut the carrots into k pieces. For some reason, all resulting carrot lengths must be positive integers.

Big carrots are very difficult for rabbits to handle and eat, so the time needed to eat a carrot of size x is x^2.

Help Zookeeper split his carrots while minimizing the sum of time taken for rabbits to eat the carrots.

Input

The first line contains two integers n and k (1 ≤ n ≤ k ≤ 10^5): the initial number of carrots and the number of rabbits.

The next line contains n integers a_1, a_2, …, a_n (1 ≤ a_i ≤ 10^6): lengths of carrots.

It is guaranteed that the sum of a_i is at least k.

Output

Output one integer: the minimum sum of time taken for rabbits to eat carrots.

Examples

Input


3 6
5 3 1


Output


15


Input


1 4
19


Output


91

Note

For the first test, the optimal sizes of carrots are \{1,1,1,2,2,2\}. The time taken is 1^2+1^2+1^2+2^2+2^2+2^2=15

For the second test, the optimal sizes of carrots are \{4,5,5,5\}. The time taken is 4^2+5^2+5^2+5^2=91.
import java.util.*;
import java.io.*;

public class E2 {
	static PrintWriter out = new PrintWriter(System.out);

	static int N,K;
	static long[] ar;
	
	static final boolean debug = false;
	
	public static void main(String[] args) {
		FS in = new FS();

		N = in.nextInt();
		K = in.nextInt();
		ar = new long[N];
		for(int i = 0; i < N; i++) ar[i] = in.nextInt();
		
		// Initially take 1 of everything
		long res = 0;
		for(long ll : ar) res += ll*ll;
		
		int cur[] = new int[N];
		Arrays.fill(cur, 1);
		
		// Get deltas
		long delta[] = new long[N];
		for(int i = 0; i < N; i++) {
			delta[i] = delta(ar[i], 1);
		}
		
		int curHave = N;
		
		if(debug) System.out.println(cost(5,1)+" "+cost(5,2));
		
		PriorityQueue<Integer> pq = new PriorityQueue<>((a,b) -> Long.compare(delta[a], delta[b]));
		for(int i = 0; i < N; i++) pq.add(i);
		
		if(debug) System.out.println("CURRES = "+res+" HAVE + "+curHave);
		
		while(curHave < K) {
			int id = pq.poll();
			res += delta[id];
			
			if(debug) System.out.println(" id = "+id+" del = "+delta[id]);
			
			curHave++;
			cur[id]++;
			delta[id] = delta(ar[id], cur[id]);
			pq.add(id);
		}
		
		out.println(res);
	
		out.close();
	}
	
	static long delta(long val, int cur) {
		return cost(val, cur+1) - cost(val, cur);
	}
	
	static long cost(long val, int cur) {
		long each = val/cur;
		long extra = val%cur;
		
		long normal = cur - extra;
		
		return normal*each*each + extra*((each+1)*(each+1));
	}

	
	static class FS{
		BufferedReader br;
		StringTokenizer st;
		public FS() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		String next() {
			while(st == null || !st.hasMoreElements()) {
				try {st = new StringTokenizer(br.readLine());}
				catch(Exception e) { throw null;}
			}
			return st.nextToken();
		}
		int nextInt() { return Integer.parseInt(next());}
		double nextDouble() { return Double.parseDouble(next());}
		long nextLong() { return Long.parseLong(next());}
		int[] NIA(int n) {
			int r[] = new int[n];
			for(int i = 0; i < n; i++) r[i] = nextInt();
			return r;
		}
		long[] NLA(int n) {
			long r[] = new long[n];
			for(int i = 0; i < n; i++) r[i] = nextLong();
			return r;
		}
		char[][] grid(int r, int c){
			char res[][] = new char[r][c];
			for(int i = 0; i < r; i++) {
				char l[] = next().toCharArray();
				for(int j = 0; j < c; j++) {
					res[i][j] = l[j];
				}
			}
			return res;
		}
	}
	
}
