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 Main {
	static BufferedReader br;
	static PrintWriter pr;
	static int cin() throws Exception
	{
		return Integer.valueOf(br.readLine());
	}
	static int[] split() throws Exception
	{
		String[] cmd=br.readLine().split(" ");
		int[] ans=new int[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Integer.valueOf(cmd[i]);
		}
		return ans;
	}
	static long[] splitL() throws IOException
	{
		String[] cmd=br.readLine().split(" ");
		long[] ans=new long[cmd.length];
		for(int i=0;i<cmd.length;i++)
		{
			ans[i]=Long.valueOf(cmd[i]);
		}
		return ans;
	}
	static int sum(long n)
	{
		int ans=0;
		while(n!=0)
		{
			ans=ans+(int)(n%10);
			n=n/10;
		}
		return ans;
	}
	static long gcd(long x,long y)
	{
		if(x==0)
			return y;
		if(y==0)
			return x;
		if(x>y)
			return gcd(x%y,y);
		else
			return gcd(x,y%x);
	}
	public static void main(String[] args) throws Exception{
		// TODO Auto-generated method stub
		br=new BufferedReader(new InputStreamReader(System.in));
		pr=new PrintWriter(new OutputStreamWriter(System.out));
		int cases=1;
		while(cases!=0)
		{
			cases--;
			int[]ar=split();
			int n=ar[0];
			int k=ar[1];
			int[]arr=split();
			PriorityQueue<Pair> pq=new PriorityQueue<>();
		    for(int i=0;i<n;i++)
		    {
		        pq.add(new Pair(arr[i],1));
		    }
		    for(int i=0;i<k-n;i++)
		    {
		        Pair p=pq.poll();
		        pq.add(new Pair(p.len,p.parts+1));
		    }
		    long ans=0;
		    for(Pair p:pq)
		    {
		        //System.out.println(p.len+" "+p.parts);
		        ans=ans+p.val(p.len,p.parts);
		    }
		    System.out.println(ans);
		}
	}
}
class Pair implements Comparable<Pair>
{
    int len;
    int parts;
    public Pair(int len,int parts)
    {
        this.len=len;
        this.parts=parts;
    }
    public long val(int l,int p)
    {
        long x=l/p;
        long y=x+1;
        long cnt1=l%p;
        long cnt2=p-cnt1;
        return cnt2*x*x+cnt1*y*y;
    }
    public long imp()
    {
        return val(this.len,this.parts)-val(this.len,this.parts+1);
    }
    public int compareTo(Pair p)
    {
        if(this.imp()>p.imp())
        return -1;
        else if(this.imp()<p.imp())
        return 1;
        return 0;
    }
}