#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
using namespace std;

typedef long long ll;

vector<ll> update(vector<ll> &a, ll n){
  vector<ll> c(n, 0);
  
  for ( ll i = 0; i < n; i++ ){
    for ( ll j = i - a[i]; j <= i + a[i]; j++ ){
      if (j < 0 || j >= n) continue;
      c[j]++;
    }
  }  
  return c;
}

int check(vector<ll> q, ll n){
  for (auto a: q ){
    if (a != n )
      return 0;
  }
  return 1;
}

int print_vec(vector<ll> v){
  for ( auto a : v )
    cout << a << " ";
  cout << endl;
  
  return 0;
}  

int main(int argc, const char * argv[]) {
    
//    std::ifstream in("input.txt");
//    std::cin.rdbuf(in.rdbuf());
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
  ll n, k;
  cin >> n >> k;
  
  vector<ll> a(n);
  for (ll i = 0; i < n; i++ )
    cin >> a[i];
  
  vector<ll> b(n, 0LL);
  
  for ( ll i = 0; i < k; i++ ){
    b = a;

    if (check(b, n)){
      print_vec(b);
      return 0;
    }else{
      a = update(b, n);
    }
  }

    print_vec(a);
    return 0;
}

