#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")

#include <stdio.h>

int main(void)
{
    int n, k, in, i, j, t;

    scanf("%d %d", &n, &k);
    int a[n], b[n];

    for(i = 0; i < n; i++)
        a[i] = 0;

    for(i = 0; i < n; i++)
    {
        scanf("%d", &in);
        t = i + in < n ? i+in+1:n;
        for(j = 0 > i - in ? 0: i-in; j < t; j++)
            a[j]++;
    }

    while(--k)
    {
        for(i = 0; i < n; i++)
        {
            b[i] = a[i];
            a[i] = 0;
        }

        for(i = 0; i < n; i++)
        {
            t = i + b[i] < n ? i+b[i]+1:n;
            for(j = 0 > i - b[i] ? 0: i-b[i]; j < t; j++)
                a[j]++;
        }
    }

    for(i = 0; i < n; i++)
        printf("%d ", a[i]);

    return 0;
}
