#include <stdio.h>
#include <unistd.h>
#define max(a, b) ((a) > (b) ? (a) : (b))
#define min(a, b) ((a) < (b) ? (a) : (b))

int main(void)
{
    char f = 0, f2, ff; int tmp1, tmp2;
    int i, ii, p;
    int n, k, l[2][200005];
    scanf("%d%d", &n, &k);
    for (i = 0; i < n; i++)
    {
        scanf("%d", l[0] + i);
    }

    f = 0;
    for (p = 0; p < k / 2; p++)
    {
        for (i = 0; i < n; i++)
        {
            tmp1 = max(i - l[f][i], 0);
            tmp2 = min(i + l[f][i], n - 1);
            f2 = f * (-1) + 1;
            for (ii = tmp1; ii <= tmp2; ii++)
                l[f2][ii]++; 
    
            l[f][i] = 0;
            
        }
        f = f2;
        ff = 0;
        
        
        for (i = 0; i < n; i++)
        {
            if (l[f][i] < n)
            {
                ff = 1;
                break;
            }
        }
        if (ff == 0)
        {
            for (i = 0; i < n - 1; i++)
                printf("%d ", n);
            printf("%d", n);
            return (0);
        }
        
    }
    
    
    
    
    
    
    
    for (p = p; p < k; p++)
    {
        for (i = 0; i < n; i++)
        {
            tmp1 = max(i - l[f][i], 0);
            tmp2 = min(i + l[f][i], n - 1);
            f2 = f * (-1) + 1;
            for (ii = 0; ii <tmp1; ii++)
                l[f2][ii]--; 
            for (ii = tmp2 + 1; ii < n - 1; ii++)
                l[f2][ii]--;
            l[f][i] = n;
            
        }
        f = f2;
        ff = 0;
        
        
        for (i = 0; i < n; i++)
        {
            if (l[f][i] < n)
            {
                ff = 1;
                break;
            }
        }
        if (ff == 0)
        {
            for (i = 0; i < n - 1; i++)
                printf("%d ", n);
            printf("%d", n);
            return (0);
        }
        
    }
    
    
    
    for (i = 0; i < n - 1; i++)
    {
        printf("%d ", l[f][i]);
    }
    printf("%d", l[f][n - 1]);
    return (0);
}