#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, m;
  cin >> n >> m;
  long long a[n + 1];
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  long long b = m, tur = 0;
  for (long long i = 0; i < n; i++) {
    tur = 0;
    if ((b - a[i]) <= 0) {
      a[i] = a[i] - b;
      tur++;
      tur += a[i] / m;
      b = m - (a[i] % m);
    } else {
      b = b - a[i];
    }
    cout << tur << ' ';
  }
  cout << endl;
  return 0;
}
