#include <stdio.h>

void main()
{
    int n, k, a[200001], b[200001];

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

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

    for (int l = 0; l < k; l++)
    {
        for (int i = 0; i < n; i++)
        {
            for (int j = i - a[i]; j <= i + a[i]; j++)
            {
                if (j < 0 || j > n - 1)
                    continue;

                b[j]++;
            }

            a[i] = b[i];
            b[i] = 0;
        }
    }

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