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.
/*
If you want to aim high, aim high
Don't let that studying and grades consume you
Just live life young
******************************
What do you think? What do you think?
1st on Billboard, what do you think of it
Next is a Grammy, what do you think of it
However you think, I’m sorry, but shit, I have no fcking interest
*******************************
I'm standing on top of my Monopoly board
That means I'm on top of my game and it don't stop
til my hip don't hop anymore
https://www.a2oj.com/Ladder16.html
*******************************
Shining through the city with a little funk and soul
*/
import static java.lang.Math.max;
import static java.lang.Math.min;
import static java.lang.Math.abs;
import java.util.*;
import java.io.*;
import java.math.*;

   public class E2
   {
      public static void main(String hi[]) throws Exception
      {
         BufferedReader infile = new BufferedReader(new InputStreamReader(System.in));
         StringTokenizer st = new StringTokenizer(infile.readLine());
         int N = Integer.parseInt(st.nextToken());
         int K = Integer.parseInt(st.nextToken());
         int[] arr = new int[N];
         st = new StringTokenizer(infile.readLine());
         for(int i=0; i < N; i++)
            arr[i] = Integer.parseInt(st.nextToken());
         PriorityQueue<Node> pq = new PriorityQueue<Node>((x,y) -> {
            long a1 = calc(x.val, x.groups);
            long a2 = calc(x.val, x.groups+1);
            long b1 = calc(y.val, y.groups);
            long b2 = calc(y.val, y.groups+1);
            long d1 = a1-a2;
            long d2 = b1-b2;
            if(d1 > d2)
               return -1;
            else if(d1 < d2)
               return 1;
            return 0;
         });
         long res = 0L;
         for(int i=0; i < N; i++)
         {
            pq.add(new Node(arr[i], 1));
            res += (long)arr[i]*arr[i];
         }
         K -= N;
         while(K-->0)
         {
            Node curr = pq.poll();
            long diff = calc(curr.val, curr.groups)-calc(curr.val, curr.groups+1);
            res -= diff;
            curr.groups++;
            pq.add(curr);
         }
         System.out.println(res);
      }
      public static long calc(int v, long groups)
      {
         if(groups >= v)
            return v;
         long base = v/groups;
         long rem = v%groups;
         long res = rem*(base+1)*(base+1);
         res += (groups-rem)*base*base;
         return res;
      }
   }
   class Node
   {
      public int val;
      public int groups;
      
      public Node(int a, int b)
      {
         val = a;
         groups = b;
      }
   }