#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 50, M = 1e4 + 2, OO = 0x3f3f3f3f;
int n, m, A[N], rem;
int main() {
  scanf("%d %d", &n, &m);
  rem = m;
  for (int i = 0; i < n; ++i) {
    scanf("%d", A + i);
    int ans = 0;
    if (A[i] >= rem) ans = 1, A[i] -= rem, rem = m;
    ans += A[i] / m;
    rem -= A[i] % m;
    printf("%d\n", ans);
  }
  return 0;
}
