#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 1e5 + 5;
inline long long power(long long a, long long b) {
  long long x = 1;
  a = a % mod;
  while (b) {
    if (b & 1) x = (x * a) % mod;
    a = (a * a) % mod;
    b >>= 1;
  }
  return x;
}
inline long long inv(long long a) { return power(a, mod - 2); }
long long gcd(long long a, long long b) { return a ? gcd(b % a, a) : b; }
long long n, m;
int main() {
  cin >> n >> m;
  long long left = m;
  long long ans, tmp;
  for (int i = 0; i < n; i++) {
    cin >> tmp;
    if (tmp <= left) {
      if (left == tmp)
        cout << "1 ";
      else
        cout << "0 ";
      left -= tmp;
      if (left == 0) left = m;
    } else {
      ans = 1;
      tmp -= left;
      ans += (tmp / m);
      tmp = tmp % m;
      left = m - tmp;
      if (left == 0) {
        ans++;
        left = m;
      }
      cout << ans << " ";
    }
  }
  return 0;
}
