#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  cin >> n >> m;
  int prev = m;
  for (int i = 0; i < n; i++) {
    int ans = 0;
    int pages;
    cin >> pages;
    if (pages < prev) {
      cout << 0 << " ";
      prev -= pages;
    } else {
      ans++;
      pages -= prev;
      prev = m;
      int x = pages / m;
      ans += x;
      pages -= x * m;
      prev -= pages;
      cout << ans << " ";
    }
  }
  cout << endl;
}
