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.
#include <bits/stdc++.h>
using namespace std;
const long long M = 1e9 + 7;
long long add(long long a, long long b) {
  (a += b) %= M;
  (a += M) %= M;
  return a;
}
long long mul(long long a, long long b) {
  (a *= b) %= M;
  (a += M) %= M;
  return a;
}
long long fastpo(long long a, long long x) {
  if (x == 0) return 1ll;
  if (x == 1) return a;
  long long y = fastpo(a, x / 2);
  if (x % 2 == 0) {
    return y * y;
  }
  return y * y * a;
}
long long inv(long long a, long long M) { return fastpo(a, M - 2); }
long long gcdExtended(long long a, long long b, long long *x, long long *y) {
  if (a == 0) {
    *x = 0, *y = 1;
    return b;
  }
  long long x1, y1;
  long long gcd = gcdExtended(b % a, a, &x1, &y1);
  *x = y1 - (b / a) * x1;
  *y = x1;
  return gcd;
}
long long modInverse(long long a, long long m) {
  long long x, y;
  long long g = gcdExtended(a, m, &x, &y);
  if (g != 1)
    return -1;
  else {
    long long res = (x % m + m) % m;
    return res;
  }
}
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
void print(vector<int> &a) {
  int n = a.size();
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
void print(vector<long long> &a) {
  int n = a.size();
  for (int i = 0; i < n; i++) {
    cout << a[i] << " ";
  }
  cout << endl;
}
bool pos(vector<long long> &a, long long k, long long m) {
  long long n = a.size();
  long long piece = 0;
  for (long long i = 0; i < n; i++) {
    long long x = (a[i] + m - 1) / m;
    piece += x;
  }
  if (piece > k) return false;
  return true;
}
long long bs(vector<long long> &a, long long k, long long lo, long long hi) {
  long long n = a.size();
  if (lo == hi) return lo;
  if (lo + 1 == hi) {
    if (pos(a, k, lo)) return lo;
    return hi;
  }
  long long mi = (lo + hi) / 2;
  if (pos(a, k, mi)) return bs(a, k, lo, mi);
  return bs(a, k, mi + 1, hi);
}
long long curr(long long a, long long k) {
  long long p = a / k, q = p + 1;
  long long x = k * q - a, y = k - x;
  long long ans = x * p * p + y * q * q;
  return ans;
}
long long red(long long a, long long k) {
  long long c1 = curr(a, k), c2 = curr(a, k + 1);
  return c1 - c2;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t;
  t = 1;
  while (t--) {
    long long n, k;
    cin >> n >> k;
    vector<long long> a(n);
    long long s = 0;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      s += a[i];
    }
    long long ans = 0;
    priority_queue<pair<long long, pair<long long, long long>>> pq;
    for (int i = 0; i < n; i++) {
      pq.push({red(a[i], 1), {a[i], 1}});
    }
    for (int i = 0; i < (k - n); i++) {
      pair<long long, pair<long long, long long>> pr = pq.top();
      pq.pop();
      long long x = pr.second.second, val = pr.second.first;
      pq.push({red(val, x + 1), {val, x + 1}});
    }
    for (int i = 0; i < n; i++) {
      pair<long long, pair<long long, long long>> pr = pq.top();
      pq.pop();
      long long x = pr.second.second, val = pr.second.first;
      ans += curr(val, x);
    }
    cout << ans << endl;
    continue;
  }
  return 0;
}
