#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, m;
  int page = 0;
  cin >> n >> m;
  int pos = 0;
  int arr[n];
  int pages[n];
  for (int i = 0; i < n; i++) cin >> arr[i];
  for (int i = 0; i < n; i++) {
    int page = 0;
    if (pos == 0) {
      page += arr[i] / (m);
      pos = arr[i] % (m);
    } else {
      if (arr[i] / (m - pos)) {
        page++;
        page += (arr[i] - (m - pos)) / m;
        pos = (arr[i] - (m - pos)) % m;
      } else
        pos += arr[i];
    }
    if (pos == m) pos = 0;
    pages[i] = page;
  }
  for (int i = 0; i < n; i++) cout << pages[i] << " ";
  return 0;
}
