#include    <stdio.h>
#include    <string.h>

int main(void)
{
    int n, k;
    int	a[200000] = { 0, };

    if (fscanf(stdin, "%d %d", &n, &k) == EOF) {
	return 1;
    }

    for (int i = 0; i < n; i++) {
	if (fscanf(stdin, "%d", a+i) == EOF) {
	    return 1;
	}
    }

    for (int j = 0; j < k; j++) {
	int b[200000] = { 0, };

	for (int i = 0; i < n; i++) {
	    for (int d = i - a[i]; d <= i + a[i]; d++) {
		if (d < 0)
		    continue;
		if (d > 200000)
		    break;
		b[d]++;
	    }
	}
	for (int i = 0; i < n; i++)
	    a[i] = b[i];
	//memcpy(a, b, n * sizeof(int));
    }

    for (int i = 0; i < n; i++) {
	printf("%d ", a[i]);
    }
    printf("\n");
    return 0;
}
