#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int n, m, x, c = 0, y = 0;
  cin >> n >> m;
  for (long long int i = 1; i <= n; i++) {
    cin >> x;
    if (m - c > x) {
      cout << "0 ";
      c = c + x;
    } else {
      y = 1;
      x -= (m - c);
      y += x / m;
      cout << y << " ";
      c = x % m;
    }
  }
}
