#include <bits/stdc++.h>
using namespace std;
void openFiles() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long int n, m;
  cin >> n >> m;
  long long int a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  vector<long long int> v;
  long long int day = 0;
  long long int used = 0;
  for (long long int i = 0; i < n; i++) {
    long long int left = m - used;
    day = 0;
    day = 0;
    if (a[i] < left) {
      left -= a[i];
      used = m - left;
      v.push_back(day);
    } else if (a[i] == left) {
      used = 0;
      day = 1;
      v.push_back(day);
    } else {
      day = 1;
      a[i] -= left;
      day += (a[i] / m);
      used = a[i] % m;
      v.push_back(day);
    }
  }
  for (auto x : v) {
    cout << x << " ";
  }
  return 0;
}
