#include <bits/stdc++.h>
using namespace std;
int k, cd, m[1000000], t[1000000];
void inp() {
  cin >> cd >> k;
  for (int i = 1; i <= cd; i++) cin >> m[i];
}
void no_copy() {
  int remain = 0;
  for (int i = 1; i <= cd; i++) {
    if (m[i] <= remain) {
      remain -= m[i];
      t[i] = 0;
    } else {
      if (i > 1) {
        if (remain == 0)
          t[i - 1]++;
        else
          t[i]++;
      }
      m[i] -= remain;
      remain = (k - m[i] % k) % k;
      t[i] += m[i] / k;
      if (remain == 0) t[i]--;
    }
  }
  if (remain == 0) t[cd]++;
  for (int i = 1; i < cd + 1; i++) cout << t[i] << " ";
}
int main() {
  inp();
  no_copy();
}
