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 int MOD = 998244353;
long long int MulMod(long long int a, long long int b) { return (a * b) % MOD; }
long long int AddMod(long long int a, long long int b) { return (a + b) % MOD; }
long long int Cost(long long int Siz, long long int Par) {
  long long int eachSiz = Siz / Par;
  long long int cntSmall = Par;
  long long int cntLarge = Siz % Par;
  cntSmall -= cntLarge;
  long long int totalCnt =
      cntSmall * eachSiz * eachSiz + cntLarge * (eachSiz + 1) * (eachSiz + 1);
  return totalCnt;
}
const long long int MAXN = 1e6 + 10;
long long int cnt[MAXN], a[MAXN];
void solving() {
  long long int n, k, ans = 0;
  cin >> n >> k;
  for (long long int i = (1); i <= (n); i++) cnt[i] = 1;
  priority_queue<pair<long long int, long long int>> pq;
  for (long long int i = (1); i <= (n); i++) {
    cin >> a[i];
    ans += Cost(a[i], 1);
    if (a[i] > cnt[i])
      pq.push(make_pair(Cost(a[i], cnt[i]) - Cost(a[i], cnt[i] + 1), i));
  }
  for (long long int i = (n + 1); i <= (k); i++) {
    auto top = pq.top();
    pq.pop();
    ans -= top.first;
    long long int idx = top.second;
    cnt[idx]++;
    if (a[idx] > cnt[idx])
      pq.push(
          make_pair(Cost(a[idx], cnt[idx]) - Cost(a[idx], cnt[idx] + 1), idx));
  }
  cout << ans << '\n';
}
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long int t = 1;
  for (long long int i = (1); i <= (t); i++) {
    solving();
  }
}
