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 E {
    private FastScanner in;
    private PrintWriter out;

    public E(FastScanner in, PrintWriter out) {
        this.in = in;
        this.out = out;
    }

    public static void main(String[] args) {
        try (
                FastScanner in = new FastScanner(System.in);
                PrintWriter out = new PrintWriter(System.out);
        ) {
            E solution = new E(in, out);
            solution.solve();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void solve() throws IOException {
        int n = in.nextInt();
        int k = in.nextInt();
        long[] a = new long[n];
        long[] value = new long[n];
        long sum = 0;
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
            sum += a[i];
        }
        long d = (sum / k);
        long res = 0;
        PriorityQueue<Profit> profits = new PriorityQueue<>(Comparator.comparing(Profit::getAmount).reversed());
        for (int i = 0; i < n; i++) {
            value[i] = a[i] * a[i];
            if(a[i] >= 2){
                profits.add(new Profit(i, 2, value[i] - getValue(2, a[i])));
            }
            res+=value[i];
        }
        for (int i = n; i < k; i++) {
            Profit profit = profits.poll();
            value[profit.i] -= profit.amount;
            res-=profit.amount;
            int newParts = profit.newPartsNumber + 1;
            if(a[profit.i] >= newParts){
                Profit newProfit = new Profit(profit.i, newParts, value[profit.i] - getValue(newParts, a[profit.i]));
                profits.add(newProfit);
            }
        }
        out.println(res);
    }

    public long getValue(int parts, long length) {
        long base = length / parts;
        long bad = length % parts;
        return parts * base * base + (2 * base + 1) * bad;
    }

    public class Profit {
        int i;
        int newPartsNumber;
        long amount;

        public Profit(int i, int newPartsNumber, long amount) {
            this.i = i;
            this.newPartsNumber = newPartsNumber;
            this.amount = amount;
        }

        public int getI() {
            return i;
        }

        public int getNewPartsNumber() {
            return newPartsNumber;
        }

        public long getAmount() {
            return amount;
        }
    }


    public static class FastScanner implements Closeable {
        BufferedReader bufferedReader;
        StringTokenizer stringTokenizer;

        public FastScanner(InputStream inputStream) {
            this.bufferedReader = new BufferedReader(new InputStreamReader(inputStream));
        }

        public FastScanner(File file) throws FileNotFoundException {
            this(new FileInputStream(file));
        }

        public String next() throws IOException {
            while (stringTokenizer == null || !stringTokenizer.hasMoreTokens()) {
                String line = bufferedReader.readLine();
                if (line == null) {
                    throw new EOFException("End of input stream is reached.");
                }
                stringTokenizer = new StringTokenizer(line);
            }
            return stringTokenizer.nextToken();
        }

        public String nextLine() throws IOException {
            stringTokenizer = null;
            return bufferedReader.readLine();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public int[] nextIntArray(int n) throws IOException {
            int[] res = new int[n];
            for (int i = 0; i < n; i++) {
                res[i] = nextInt();
            }
            return res;
        }

        public List<Integer> nextIntList(int n) throws IOException {
            List<Integer> res = new ArrayList<>(n);
            for (int i = 0; i < n; i++) {
                res.add(nextInt());
            }
            return res;
        }

        @Override
        public void close() throws IOException {
            bufferedReader.close();
        }
    }
}