#include <bits/stdc++.h>
using namespace std;
const long long N = 1234567;
const long long MOD = 998244353;
void solve() {
  long long n, m, i, j, k, l, o, p;
  cin >> n >> m;
  p = m;
  for (long long i = 0; i < n; i++) {
    cin >> k;
    if (k > p) {
      k -= p;
      p = m;
      l = k / p;
      k -= p * (k / p);
      p -= k;
      if (p)
        cout << l + 1 << " ";
      else
        cout << l + 2 << " ";
    } else {
      p -= k;
      if (p)
        cout << "0 ";
      else
        cout << "1 ", p = m;
    }
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  while (t--) solve();
  return 0;
}
