#include <bits/stdc++.h>
using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int n, k;
  cin >> n >> k;

  vector<int> a(n);
  for (int& e: a)
    cin >> e;

  vector<int> s(n + 1);
  for (int i = 0; i < 100 && k > 0; ++i, --k) {
    for (int i = 0; i < n; ++i) {
      int l = max(i - a[i], 0);
      int r = min(i + a[i], n - 1);
      ++s[l];
      --s[r + 1];
    }

    int cur = 0;
    for (int i = 0; i < n; ++i) {
      cur += s[i];
      a[i] = cur;
      s[i] = 0;
    }
  }

  for (int e: a)
    cout << e << ' ';
  
  cout << '\n';
}