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;
using ll = long long;
using Vi = std::vector<int>;
using Vl = std::vector<ll>;
using Pii = std::pair<int, int>;
using Pll = std::pair<ll, ll>;
constexpr int I_INF = std::numeric_limits<int>::max();
constexpr ll L_INF = std::numeric_limits<ll>::max();
template <typename T1, typename T2>
inline bool chmin(T1& a, const T2& b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template <typename T1, typename T2>
inline bool chmax(T1& a, const T2& b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
class Prints {
 private:
  class __Prints {
   public:
    __Prints(const char* sep, const char* term) : sep(sep), term(term) {}
    template <class... Args>
    void operator()(const Args&... args) const {
      print(args...);
    }
    template <typename T>
    void pvec(const T& vec, size_t sz) const {
      for (size_t i = 0; i < sz; i++)
        std::cout << vec[i] << (i == sz - 1 ? term : sep);
    }
    template <typename T>
    void pmat(const T& mat, size_t h, size_t w) {
      for (size_t i = 0; i < h; i++)
        for (size_t j = 0; j < w; j++)
          std::cout << mat[i][j] << (j == w - 1 ? term : sep);
    }

   private:
    const char *sep, *term;
    void print() const { std::cout << term; }
    void print_rest() const { std::cout << term; }
    template <class T, class... Tail>
    void print(const T& head, const Tail&... tail) const {
      std::cout << head, print_rest(tail...);
    }
    template <class T, class... Tail>
    void print_rest(const T& head, const Tail&... tail) const {
      std::cout << sep << head, print_rest(tail...);
    }
  };

 public:
  Prints() {}
  __Prints operator()(const char* sep = " ", const char* term = "\n") const {
    return __Prints(sep, term);
  }
};
Prints prints;
void solve() {
  int N, K;
  cin >> N >> K;
  Vl A(N);
  for (ll i = 0; i < N; i++) {
    cin >> A[i];
  }
  auto calc = [](ll x, ll a) -> ll {
    ll q = x / a;
    ll r = x % a;
    return (q + 1) * (q + 1) * r + q * q * (a - r);
  };
  Vl ds(N, 1);
  priority_queue<Pll> pq;
  for (ll i = 0; i < N; i++) {
    ll t1 = A[i] * A[i];
    ll t2 = calc(A[i], 2);
    pq.emplace(t1 - t2, i);
  }
  ll rsd = K - N;
  while (rsd--) {
    auto [x, idx] = pq.top();
    pq.pop();
    ++ds[idx];
    if (ds[idx] < A[idx]) {
      pq.emplace(calc(A[idx], ds[idx]) - calc(A[idx], ds[idx] + 1), idx);
    }
  }
  ll ans = 0;
  for (ll i = 0; i < N; i++) {
    ans += calc(A[i], ds[i]);
  }
  prints()(ans);
}
int main() {
  std::cin.tie(nullptr), std::cout.tie(nullptr);
  std::ios::sync_with_stdio(false);
  std::cout << std::setprecision(18) << std::fixed;
  solve();
  std::cout << std::flush;
  return 0;
}
