#pragma GCC optimize("Ofast")
#include <stdio.h>
#include <string.h>


int main (void){
    long int n,k;
    scanf("%ld %ld",&n,&k);
    long int a[(int)n];
    long int point[n];
    int cnt=0;
    for(int i=0;i<n;i++)scanf("%ld",&a[i]) ,point[i] = 0;

    for(int i = 0;i<k-1;i++){
        for(int j=0;j<n;j++){//各電球を見る
            long int min = j-a[j]>0?j-a[j]:0;
            long int max = j+a[j]<n?j+a[j]:n;
            for(int x = min;x<=max ;x++,point[x]++);
        }

        for(int j=0;j<n;j++) a[j] = point[j],point[j] = 0;
    }


    for(int j=0;j<n;j++){//各電球を見る
        long int min = j-a[j]>0?j-a[j]:0;
        long int max = j+a[j]<n?j+a[j]:n;
        for(int x = min;x<=max ;x++,point[x]++);
    }

    for(int i=0;i<n-1;i++)printf("%ld ",point[i]);
    printf("%ld",point[n-1]);


    return 0;
}