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

public class A {
	public static void main (String[] args) { new A(); }

	public A() {
		FastScanner fs = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		System.err.println("");

		int T = 1;
		while(T-->0) {
			int n = fs.nextInt();
			int k = fs.nextInt();
			int[] a = fs.nextIntArray(n);
			
			PriorityQueue<Pair> pq = new PriorityQueue<>();
			int curAmt = n;
			
			int[] splitInto = new int[n];
			for(int i = 0; i < n; i++) {
				splitInto[i] = 1;
				if(a[i] == 1) {
					continue;
				}
				
				long tx = a[i]/2;
				long ty = a[i]/2 + (a[i] % 2);
				long get = tx*tx + ty*ty;
				
				long now = (long)a[i]*a[i];
				
				pq.add(new Pair(a[i], now-get, 1, i));
			}
			
			while(curAmt < k) {
				curAmt++;
				Pair who = pq.poll();
				
				//split them
				splitInto[who.idx]++;
				
				who.curParts++;
				if(who.curParts == who.num) continue;
				
				long curCost = getCost(who.num, who.curParts);
				long nxtCost = getCost(who.num, who.curParts + 1);
				
				pq.add(new Pair(who.num, curCost-nxtCost, who.curParts, who.idx));
			}
			
			long res = 0;
			for(int i = 0; i < n; i++) {
				res += getCost(a[i], splitInto[i]);
			}
			
			out.println(res);
		}
		
		out.close();
	}
	
	long getCost(long num, int parts) {
		long per = num / parts;
		long rem = num % parts;
		long res = 0;
		
		long x = per+1, y = per;
		res += x*x * rem;
		res += y*y * (parts-rem);
		
		return res;
	}
	
	class Pair implements Comparable<Pair> {
		long num, delta;
		int curParts, idx;
		
		Pair(long n, long d, int c, int i) {
			curParts = c;
			num = n;
			delta = d;
			idx = i;
		}
		public int compareTo(Pair p) {
			return Long.compare(p.delta, delta);
		}
	}

	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) {
			try {
				in = new BufferedInputStream(new FileInputStream(new File(s)), BS);
			}
			catch (Exception e) {
				in = new BufferedInputStream(System.in, 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;
		}
		
	}

}