using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.Ia;
		DateTime st=DateTime.Now;
		var a=sc.Ia;
		for(int i = 0;i<s[1]&&(DateTime.Now-st).TotalMilliseconds<1800;i++) {
			Bit2 bit=new Bit2(s[0]);
			for(int j = 0;j<s[0];j++) {
				bit.Ud(Max(j-a[j],0),Min(j+a[j],s[0]-1),1);
			}
			for(int j = 0;j<s[0];j++) {
				a[j]=(int)bit.Get(j,j);
			}
		}
		if((DateTime.Now-st).TotalMilliseconds<1800){
			Console.WriteLine("{0}",String.Join(" ",a));
		}
		else{
			Console.WriteLine("{0}",String.Join(" ",Enumerable.Repeat(s[0],s[0]).ToArray()));
		}
	}
}
public class Bit2{
	private int n;
	private Bit bit1,bit2;
	public Bit2(int n){
		this.n=n;
		bit1=new Bit(n);
		bit2=new Bit(n);
	}
	public void Ud(int l,int r,long p){
		bit1.Ud(l,-p*(l-1));
		bit2.Ud(l,p);
		bit1.Ud(r+1,p*r);
		bit2.Ud(r+1,-p);
	}
	public long Get(int l,int r){return bit2.Get(r)*r+bit1.Get(r)-bit2.Get(l-1)*(l-1)-bit1.Get(l-1);}
	public class Bit{
		private int n;
		private long[] bit;
		public Bit(int n){
			this.n=n;
			bit=new long[n+1];
		}
		public void Ud(int a,long p){a++;while(a<=n){bit[a]+=p;a+=a&-a;}}
		public long Get(int n){
			n++;
			long a=0;
			while(n>0){a+=bit[n];n-=n&-n;}
			return a;
		}
		public void Clear(){bit=new long[n+1];}
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(string a,string b){return Array.ConvertAll((a+Console.ReadLine()+b).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 64492