#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m, v, r = 0;
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    int w = 0;
    cin >> v;
    if (r > 0) {
      if (r == v) {
        r = 0;
        cout << 1 << " ";
      } else if (r > v) {
        r = r - v;
        cout << 0 << " ";
      } else {
        v = v - r;
        cout << (v / m) + 1 << " ";
        r = m - v % m;
      }
    } else {
      cout << v / m << " ";
      r = m - v % m;
    }
  }
}
