#include <stdio.h>

long min(long o, long t);
long max(long o, long t);


long main() {
    long n, k;
    long power[200000];
    long temp[200000 + 1];

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

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

    long total = 0, preTotal = 0;
    for (long i = 0; i < k; i++) {
        for (long j = 0; j < n + 1; j++) {
            temp[j] = 0;
        }
        for (long j = 0; j < n; j++) {
            long s = max(0, j - power[j]);
            long e = min (n + 1, j + power[j] + 1);
            temp[s]++;
            temp[e]--;
        }

        long v = 0;
        for (long j = 0; j < n; j++) {
            power[j] = v + temp[j];
            v = power[j];
        }
        
        for (long j = 0; j < n; j++) {
            total += power[j];
        }
        if (total == preTotal) {
            break;
        }
        preTotal = total;
    }

    for (long i = 0; i < n; i++) {
        if (i != 0) {
            prlongf(" ");
        }

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

long min(long o, long t) {
    if (o < t) {
        return o;
    }
    return t;
}

long max(long o, long t) {
    if (o < t) {
        return t;
    }
    return o;
}