#include <cstdio>
#include <algorithm>

using i8 = std::int8_t;
using u8 = std::uint8_t;
using i16 = std::int16_t;
using u16 = std::uint16_t;
using i32 = std::int32_t;
using u32 = std::uint32_t;
using i64 = std::int64_t;
using u64 = std::uint64_t;
using usize = std::size_t;

i32 a[200000];

auto main() -> i32 {
	i32 n, k;
	scanf("%d%d", &n, &k);
	for (i32 i = 0; i < n; i += 1) {
		scanf("%d", a + i);
	}
	i32 b[200001];
	for (i32 step = 0; step < std::min(64, k); step += 1) {
		std::fill(b, b + n + 1, 0);
		for (i32 i = 0; i < n; i += 1) {
			b[std::max(0, i - a[i])] += 1;
			b[std::min(n, i + a[i] + 1)] -= 1;
		}
		a[0] = b[0];
		for (i32 i = 1; i < n; i += 1) {
			b[i] += b[i - 1];
			a[i] = b[i];
		}
	}
	for (i32 i = 0; i < n; i += 1) {
		printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');
	}
	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

typedef long long ll;
typedef pair<ll, ll> P;

const int mod =  1000000007;  //出力は (ans % mod + mod) % mod  (負の剰余を正にする)
const int inf = 1e9;
const long long INF = 1LL << 60;   // INF = 11

int main()
{
    int n,k; cin >> n >> k;
    int a[n];
    rep(i,n) cin >> a[i];
    int tmp[n];
    
    for(int t = 0; t < k; t++){
        rep(i,n) tmp[i] = 0;
        rep(i,n){
            if(i - a[i] < 0){
                tmp[0]++; 
            }else{
                tmp[i-a[i]]++;
            }
            if(i + 1 + a[i] < n){
                tmp[i+1+a[i]]--;
            }
        }
        a[0] = tmp[0];
        rep(i,n-1){
            a[i+1] = a[i] + tmp[i+1];
        }
        bool f = true;
        rep(i,n) if(a[i] != n) f = false;
        if(f) break;
    }
    rep(i,n) cout << a[i] << ' ';
}