/*********************************************
* c# template
* 
*********************************************/
/*********************************************
20.07.10 東京海上日動 コンテスト2020. C - Lamps

直線上で並んでいる電球たちが、
queryによって光の強さが変化する。
query操作後の各電球の光の強さを求め。

query:
1 以上 N 以下の各整数 i に対し、操作時に座標 i を照らしている電球の個数を 
Bi とする。そして、各電球 i の光の強さを Bi に変更する。

*********************************************/

namespace temp_name
{
    using System;
    using System.Linq;
    using System.Collections.Generic;
    using System.Reflection;
    using System.Text;
    using static System.Console;
    using static IOmacro.CsharpInput; 
    using static IOmacro.CppInput;

    public class Run
    {
        int[] lampLv;
        int numLamp;
        int numQry;
        
        private void init()
        {
            numLamp = cin;
            numQry = cin;
            lampLv = ("0 " + ReadLine()).Split().Select(int.Parse).ToArray();
            
        }
        
        private void refreshLampLv()
        {
            var accum = new int[numLamp + 1];
            for (int idx = 1; idx <= numLamp; idx++) {
                int lo = Math.Max(1, (int)Math.Ceiling(idx - lampLv[idx] - 0.5));
                int hi = Math.Min(numLamp, (int)Math.Truncate(idx + lampLv[idx] + 0.5));
                
                accum[lo] += 1;
                if (hi + 1 <= numLamp)
                    accum[hi + 1] -= 1;
                
            }
            for (int idx = 2; idx <= numLamp; idx++) {
                accum[idx] += accum[idx - 1];
            }
            for (int idx = 1; idx <= numLamp; idx++) {
                lampLv[idx] = accum[idx];
            }
        }
        
        private void proc()
        {
            if (numQry > 50)
                numQry = 50;
            
            for (int cnt = 0; cnt < numQry; cnt++)
                refreshLampLv();
            
            for (int idx = 1; idx <= numLamp; idx++)
                Write(lampLv[idx] + " ");
            WriteLine();
        }
        
        public void work()
        {
            init();
            proc();
        }
        
    }
}

class program
{
    static void Main()
    {
        var run = new temp_name.Run();
        run.work();
    }
}


namespace IOmacro
{
    //20.06.29 수정
    
    using System; 
    using System.Linq; 
    using System.IO;
    using System.Collections.Generic;
    
    public class CsharpInput 
    {
        public static StreamWriter _writer = new StreamWriter(Console.OpenStandardOutput());
        public const char separator = ' ';
        public static string _string{get{return Console.ReadLine();}}
        public static string[] _stringa{get{return (Console.ReadLine().Split(separator));}}
        public static int _int{get{return int.Parse(Console.ReadLine());}}
        public static int[] _inta{get{return Console.ReadLine().Split(separator).Select(int.Parse).ToArray();}}
        public static long _long{get{return long.Parse(Console.ReadLine());}}
        public static long[] _longa{get{return Console.ReadLine().Split(separator).Select(long.Parse).ToArray();}}    
        public static double _double{get{return double.Parse(Console.ReadLine());}}
        public static double[] _doublea{get{return Console.ReadLine().Split(separator).Select(double.Parse).ToArray();}}    
    }
    
    public class CppInput 
    {
        public static CppInput cin => new CppInput();
        public const char separator = ' ';
        private static readonly Queue<string> _input = new Queue<string>();
        private CppInput(){}
        public static implicit operator string(CppInput _) {
            if (_input.Count == 0) Console.ReadLine().Split(separator).foreachExtension(x => _input.Enqueue(x));
            return _input.Dequeue();
        }
        public static implicit operator int(CppInput _){
            if (_input.Count == 0) Console.ReadLine().Split(separator).foreachExtension(x => _input.Enqueue(x));
            return int.Parse(_input.Dequeue());
        }
        public static implicit operator long(CppInput _){
            if (_input.Count == 0) Console.ReadLine().Split(separator).foreachExtension(x => _input.Enqueue(x));
            return long.Parse(_input.Dequeue());
        }
        public static implicit operator double(CppInput _){
            if (_input.Count == 0) Console.ReadLine().Split(separator).foreachExtension(x => _input.Enqueue(x));
            return double.Parse(_input.Dequeue());
        }
    }
    
    public static class CEnumerableExtension 
    {
        public delegate void Function<in T>(T val);
        public static void foreachExtension<T>(this IEnumerable<T> enumerable, Function<T> function) {
            foreach (var x in enumerable) function(x);
        }
    }
}



Measured memory_bytes: 57016