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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.AbstractCollection;
import java.util.PriorityQueue;
import java.util.InputMismatchException;
import java.io.IOException;
import java.util.Comparator;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Vaibhav Pulastya
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        ECarrotsForRabbits solver = new ECarrotsForRabbits();
        solver.solve(1, in, out);
        out.close();
    }

    static class ECarrotsForRabbits {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt();
            int k = in.nextInt();
            Long[] a = new Long[n];
            for (int i = 0; i < n; i++) a[i] = in.nextLong();
            //out.println(r);
            // r
            //out.println(ext);
            PriorityQueue<Node> P = new PriorityQueue<>(new Comparator<Node>() {

                public int compare(Node o1, Node o2) {
                    long br = o1.br + 1;
                    long big = (o1.val + br - 1) / br;
                    long sml = (o1.val / br);
                    long cntb = o1.val % br;
                    long cnts = br - cntb;
                    long diff1 = (cntb * big * big) + (cnts * sml * sml) - (o1.cntb * o1.big * o1.big) - (o1.cnts * o1.sml * o1.sml);


                    br = o2.br + 1;
                    big = (o2.val + br - 1) / br;
                    sml = (o2.val / br);
                    cntb = o2.val % br;
                    cnts = br - cntb;
                    long diff2 = (cntb * big * big) + (cnts * sml * sml) - (o2.cntb * o2.big * o2.big) - (o2.cnts * o2.sml * o2.sml);

                    return Long.compare(diff1, diff2);
                }
            });
            for (int i = 0; i < n; i++) {
                // split a[i] into (a[i]+r-1)/r
                long br = 1;
                long big = (a[i] + br - 1) / br;
                long sml = (a[i] / br);
                long cntb = a[i] % br;
                long cnts = br - cntb;

                P.add(new Node(a[i], br, big, sml, cntb, cnts));
            }

            for (int i = 0; i < k - n; i++) {
                Node x = P.poll();
                x.br = x.br + 1;
                x.big = (x.val + x.br - 1) / x.br;
                x.sml = (x.val / x.br);
                x.cntb = x.val % x.br;
                x.cnts = x.br - x.cntb;
                P.add(x);
            }

            long ans = 0;
            while (!P.isEmpty()) {
                Node x = P.poll();
                ans += (x.cntb * x.big * x.big) + (x.cnts * x.sml * x.sml);
            }
            out.println(ans);


        }

        class Node {
            long val;
            long br;
            long big;
            long sml;
            long cntb;
            long cnts;

            Node(long vv, long brr, long bigg, long smll, long cntbb, long cntss) {
                br = brr;
                big = bigg;
                sml = smll;
                cntb = cntbb;
                cnts = cntss;
                val = vv;
            }

        }

    }

    static class InputReader {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1)
                throw new InputMismatchException();
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c))
                c = read();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        private boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

    }
}

