#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long n, c, j = 0, m, ans;
  cin >> n >> c;
  for (long long i = 0; i < n; i++) {
    cin >> m;
    if (m <= c - j) {
      ans = 0;
      j = j + m;
      if (j == c) {
        j = 0;
        ans = 1;
      }
    } else {
      ans = 1;
      m = m - c + j;
      ans = ans + m / c;
      j = m - c * (m / c);
    }
    cout << ans << " ";
  }
  return 0;
}
