#include <bits/stdc++.h>
using namespace std;
int const lim = 3e5 + 3;
int inp[lim + 3];
map<int, int> cnt;
int ans[1003][1003];
int main() {
  int n, m;
  cin >> n >> m;
  int cur = 0;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    if (x < m - cur) {
      cur += x;
      cout << 0 << " ";
      continue;
    }
    int ans = 1;
    x -= m - cur;
    ans += x / m;
    x %= m;
    cur = x;
    cout << ans << " ";
  }
}
