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;
mt19937 rng(
    (unsigned int)chrono::steady_clock::now().time_since_epoch().count());
long long int lol(long long int what, long long int parts) {
  long long int t1 = what / parts;
  what %= parts;
  long long int t2 = t1 + 1;
  long long int ans = (long long int)pow(t1, 2) * (parts - what);
  ans += (long long int)pow(t2, 2) * what;
  return ans;
}
long long int bachat(pair<long long int, long long int> p) {
  long long int a1 = lol(p.first, p.second);
  long long int a2 = lol(p.first, p.second + 1);
  return a1 - a2;
}
struct cmp {
  bool operator()(const pair<long long int, long long int> &a,
                  const pair<long long int, long long int> &b) const {
    long long int a1 = bachat(a);
    long long int b1 = bachat(b);
    return a1 > b1;
  }
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int n, k;
  cin >> n >> k;
  vector<long long int> a(n);
  long long int ans = 0;
  multiset<pair<long long int, long long int>, cmp> st;
  for (long long int i = 0; i < n; i++) {
    long long int temp;
    cin >> temp;
    if (temp > 1) {
      st.insert({temp, 1});
    } else {
      ans++;
    }
  }
  while (n < k) {
    pair<long long int, long long int> p = *st.begin();
    st.erase(st.begin());
    p.second++;
    if (p.second == p.first) {
      ans += p.second;
    } else {
      st.insert(p);
    }
    n++;
  }
  for (auto itr = st.begin(); itr != st.end(); ++itr) {
    ans += lol(itr->first, itr->second);
  }
  cout << ans << "\n";
}
