#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 <iostream>
#include <vector>
using namespace std;

int n, k;
bool alln(vector<int>& v){
  for(int i=0;i<n;++i) if(v[i]!=n) return false;
  return true;
}

void simulate(vector<int>& v){
  int cnt = 0;
  vector<int> tmp(n+1, 0);
  for(int i=0;i<n;++i) {
    tmp[max(0, i-v[i])]++;
    tmp[min(n, i+v[i]+1)]--;
  }
  for(int i=0;i<n;++i){
    cnt += tmp[i];
    v[i] = cnt;
  }
}

int main() {
  scanf("%d %d", &n, &k);
  vector<int> v(n);
  for(int i=0;i<n;++i) scanf("%d", &v[i]);

  while(k--){
    simulate(v);
    if(alln(v)){
      for(int i=0;i<n;++i) cout << n << (i==n-1?'\n':' ');
      return 0;
    }
  }
  for(int i=0;i<n;++i) cout << v[i] << (i==n-1?'\n':' ');
  return 0;
}
