#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) {
  return (b == 0LL ? a : gcd(b, a % b));
}
long long exp(long long a, long long b, long long m) {
  if (b == 0LL) return 1LL;
  if (b == 1LL) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1LL) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const long long N = 100100;
long long n;
long long k;
long long find_max(long long a, long long y) {
  long long l = 0, r = a;
  long long ans = 0;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (a - 3LL * mid * mid + 3LL * mid - 1 >= y) {
      ans = mid;
      l = mid + 1;
    } else
      r = mid - 1;
  }
  return ans;
}
long long a[N];
long long b[N];
long long ok(long long y) {
  long long caras = 0;
  for (long long i = 1; i <= n; i++) {
    long long maxi = find_max(a[i], y);
    caras += maxi;
  }
  if (caras >= k) return true;
  return false;
}
const long long inf = (1LL << 62LL);
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> k;
  for (long long i = 1; i <= n; i++) cin >> a[i];
  long long l = -inf, r = inf;
  long long ans = -inf;
  while (l <= r) {
    long long mid = (l + r) / 2;
    if (ok(mid)) {
      l = mid + 1;
      ans = mid;
    } else
      r = mid - 1;
  }
  long long y = ans + 1;
  long long tem = k;
  for (long long i = 1; i <= n; i++) {
    long long maxi = min(find_max(a[i], y), a[i]);
    long long coloca = (maxi);
    tem -= coloca;
    b[i] = coloca;
  }
  long long sum = 0;
  for (long long i = 1; i <= n; i++) {
    sum += b[i];
  }
  if (sum > k) {
    cout << -1 << "\n";
    return 0;
  }
  y = ans;
  sum = 0;
  for (long long i = 1; i <= n; i++) {
    sum += find_max(a[i], y);
  }
  if (sum < k) {
    cout << -1 << "\n";
    return 0;
  }
  for (long long i = 1; i <= n; i++) {
    if (tem == 0) break;
    long long maxi = min(find_max(a[i], y), a[i]);
    long long have = b[i];
    long long coloca = max(min(maxi - have, tem), 0LL);
    tem -= coloca;
    b[i] += coloca;
  }
  for (long long i = 1; i <= n; i++) {
    cout << b[i] << " ";
  }
  cout << "\n";
}
