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;
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &V) {
  long long N = V.size();
  if (N == 0) {
    os << '.';
    return os;
  }
  for (long long i = 0; i < N - 1; i++) {
    os << V[i] << ' ';
  }
  os << V[N - 1];
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<vector<T>> &V) {
  long long N = V.size();
  for (long long i = 0; i < N - 1; i++) os << V[i] << "\n";
  os << V[N - 1];
  return os;
}
template <typename T, typename S>
ostream &operator<<(ostream &os, pair<T, S> const &P) {
  os << P.first << ' ' << P.second;
  return os;
}
template <typename T>
void Vin(vector<T> &v) {
  long long n = v.size();
  for (long long i = 0; i < n; i++) cin >> v[i];
}
long long scomb(long long n, long long r) {
  if (r < 0 || r > n) return 0;
  if ((n - r) < r) r = n - r;
  long long a = 1;
  for (long long i = n; i > n - r; --i) {
    a = a * i;
  }
  for (long long i = 1; i < r + 1; ++i) {
    a = a / i;
  }
  return a;
}
vector<long long> vis(vector<long long> &v) {
  vector<long long> S(v.size() + 1);
  for (long long i = 1; i < S.size(); i++) S[i] += v[i - 1] + S[i - 1];
  return S;
}
long long digit_sum(long long n) {
  long long ret = 0;
  while (n > 0) {
    ret += n % 10;
    n /= 10;
  }
  return ret;
}
long long digit(long long k, long long i) {
  string s = to_string(k);
  return s[s.size() - i] - '0';
}
template <typename T>
void press(T &v) {
  v.erase(unique((v).begin(), (v).end()), v.end());
}
vector<long long> zip(vector<long long> b) {
  long long Z = b.size();
  pair<long long, long long> p[Z + 10];
  long long a = b.size();
  vector<long long> l(a);
  for (long long i = 0; i < a; i++) p[i] = make_pair(b[i], i);
  sort(p, p + a);
  long long w = 0;
  for (long long i = 0; i < a; i++) {
    if (i && p[i].first != p[i - 1].first) w++;
    l[p[i].second] = w;
  }
  return l;
}
long long SMALLER(vector<long long> &a, long long x) {
  return lower_bound(a.begin(), a.end(), x) - a.begin();
}
long long orSMALLER(vector<long long> &a, long long x) {
  return upper_bound(a.begin(), a.end(), x) - a.begin();
}
long long BIGGER(vector<long long> &a, long long x) {
  return a.size() - orSMALLER(a, x);
}
long long orBIGGER(vector<long long> &a, long long x) {
  return a.size() - SMALLER(a, x);
}
long long COUNT(vector<long long> &a, long long x) {
  return upper_bound((a).begin(), (a).end(), x) -
         lower_bound((a).begin(), (a).end(), x);
}
long long maxind(vector<long long> &a) {
  return max_element((a).begin(), (a).end()) - a.begin();
}
long long minind(vector<long long> &a) {
  return min_element((a).begin(), (a).end()) - a.begin();
}
const long long MOD = 1000000007;
const double EPS = 1e-10;
void init() {
  cin.tie(0);
  cout.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(12);
}
long long n, k;
vector<long long> a;
long long cut(long long n, long long k) {
  long long ret = 0;
  long long si = k;
  long long am = n % si;
  long long ki = n / si;
  long long on = am;
  long long ze = si - am;
  return ki * ki * ze + (ki + 1) * (ki + 1) * on;
}
long long mii(long long n, long long k) {
  long long be = cut(n, k);
  long long af = cut(n, k + 1);
  return be - af;
}
void sol() {
  cin >> n;
  cin >> k;
  long long ans = 0;
  a.resize(n);
  Vin(a);
  for (long long i = 0; i < n; i++) {
    ans += a[i] * a[i];
  }
  priority_queue<tuple<long long, long long, long long>> pq;
  for (long long i = 0; i < n; i++) {
    long long qw = mii(a[i], 1);
    pq.push(make_tuple(qw, a[i], 1));
  }
  long long kai = k - n;
  for (long long i = 0; i < kai; i++) {
    tuple<long long, long long, long long> now = pq.top();
    pq.pop();
    ans -= get<0>(now);
    get<2>(now)++;
    long long qw = mii(get<1>(now), get<2>(now));
    get<0>(now) = qw;
    pq.push(now);
  }
  cout << ans << "\n";
  return;
}
signed main() {
  init();
  long long t = 1;
  while (t--) sol();
  return 0;
}
