#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, i, m, res = 0;
  cin >> n >> m;
  long long a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    long long t = 0;
    if (res > 0 && res <= a[i]) {
      a[i] -= res;
      t++;
      res = 0;
    } else if (res > 0 && res > a[i]) {
      res -= a[i];
      cout << 0 << " ";
      continue;
    }
    t += a[i] / m;
    if (a[i] > m)
      res = m - a[i] % m;
    else
      res = m - a[i];
    cout << t << " ";
  }
  return 0;
}
