#include <stdio.h>

int main(){
    int n, k;
    int power[200000];
    int temp[200000];

    scanf("%d %d", &n, &k);

    for (int i = 0; i < n; i++){
        scanf("%d", &power[i]);
    }


    for (int i = 0; i < k; i++) {
        for (int i = 0; i < n; i++){
            temp[i] = 0;
        }

        for (int j = 0; j < n; j++) {
            int s, e;
            if ((j - power[j]) < 0) {
                s = 0;
            } else {
                s = j - power[j];
            }

            if ((j + power[j]) > (n - 1)) {
                e = n - 1;
            } else {
                e = j + power[j];
            }

            for (int l = s; l <= e; l++) {
                temp[l] += 1;
            }

        }
        for (int j = 0; j < n; j++) {
            power[j] = temp[j];
        }
    }

    for (int i = 0; i < n; i++) {
        if (i != 0) {
            printf(" ");
        }

        printf("%d", power[i]);
    }
}