#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 10;
int a[MAX_N], N, M;
vector<int> Pages;
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> M;
  for (int i = 0; i < N; i++) cin >> a[i];
  int last = M;
  for (int i = 0; i < N; i++) {
    int pages = 0, now = a[i];
    now -= last;
    if (now < 0) {
      last = last - a[i];
      pages = 0;
      Pages.push_back(pages);
      continue;
    }
    pages++;
    pages += now / M;
    last = now - (now / M) * M;
    last = M - last;
    Pages.push_back(pages);
  }
  for (int i = 0; i < Pages.size(); i++) cout << Pages[i] << " ";
  cout << endl;
  return 0;
}
