// Arup Guha
// 6/4/2026
// TLE version of Slide Count (O(n^2)).
// https://open.kattis.com/problems/slidecount

using namespace std;
#include <bits/stdc++.h>

int main() {

    int n, maxVal;
    cin >> n >> maxVal;

    // Read in numbers.
    vector<int> nums(n);
    for (int i=0; i<n; i++)
        cin >> nums[i];

    // Frequency array.
    vector<int> freq(n, 0);

    // Store start and end.
    int s = 0, e = 0;
    int tot = 0;

    // i goes through each window.
    for (int i=0; s<n; i++) {

        // Update for this window.
        for (int i=s; i<e; i++)
            freq[i]++;

        // Situations where I increment e.
        if (e<n && tot+nums[e] <= maxVal) {
            tot += nums[e];
            e++;
        }

        // Situations where I increment s.
        else {
            tot -= nums[s];
            s++;
        }
    }

    // Output each frequency.
    for (int i=0; i<n; i++)
        cout << freq[i] << endl;

    return 0;
}
