//{{{
#include<algorithm>
#include<cmath>
#include<deque>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(printde) FUNC(printdbe) FUNC(printdwe) FUNC(printdu) FUNC(printe) FUNC(printe0);
#endif
template <template <class T, class = std::allocator<T>> class V, class E>
istream& operator >> (istream& in, V<E>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

struct Watch {
    double prev;
    double getPrev(){
        return prev;
    }
#ifdef LOCAL
    timeval start;
    Watch(){
        gettimeofday(&start, nullptr);
    }
    double elapsed(){
        timeval now;
        gettimeofday(&now, nullptr);
        return prev = (now.tv_sec - start.tv_sec) + (now.tv_usec - start.tv_usec) / 1e6;
    }
#else
    double start;
#define ticks_per_sec 2800000000.0
    Watch(){
        start = get_time();
    }
    double elapsed(){
        return prev = get_time() - start;
    }
private:
    double get_time(){
        uint32_t lo, hi;
        asm volatile ("rdtsc" : "=a" (lo), "=d" (hi));
        return (((uint64_t)hi << 32) | lo) / ticks_per_sec;
    }
#endif
} watch;

struct SegTree {
    int cidx = -1;
    int left, right;
    int value = 0;
    static vector<SegTree> sts;
    SegTree() = default;
    SegTree(int size, int ini = 0): SegTree(vector<int>(size, ini)){ }
    SegTree(const vector<int>& data):SegTree(0, data.size() - 1, data){ }
    SegTree(int left, int right, const vector<int>& data): left(left), right(right){
        if(left == right){
            cidx = -1;
            value = data[left];
        }else{
            cidx = sts.size();
            sts.push_back({});
            sts.push_back({});
            sts[cidx] = SegTree(left, (right - left) / 2 + left, data);
            sts[cidx + 1] = SegTree((right - left) / 2 + left + 1, right, data);
        }
    }
    void setAll(int num){
        if(cidx >= 0){
            sts[cidx].setAll(num);
            sts[cidx + 1].setAll(num);
        }
        value = num;
    }
    void add(int ql, int qr, int num){
        if(right < ql || qr < left){ return; }
        if(ql <= left && right <= qr){
            value += num;
        }else{
            sts[cidx].add(ql, qr, num);
            sts[cidx + 1].add(ql, qr, num);
        }
    }
	int getVal(int pos){
        if(right < pos || pos < left){ return 0; }
        return value + (cidx >= 0 ? sts[cidx].getVal(pos) + sts[cidx + 1].getVal(pos) : 0);
	}
};
vector<SegTree> SegTree::sts;

int main(){
    Watch watch;
    cin.tie(0); ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    vector<int> as(n); cin >> as;
    // int n = 2e5, k = n;
    // vector<int> as(n, 0);
    SegTree st(as);
    SegTree next(n);
    for(int i = 0; i < min(k, 41); i++){
        next.setAll(0);
        for(int j = 0; j < n; j++){
            int value = st.getVal(j);
            next.add(j - value, j + value, 1);
        }
        swap(st, next);
        // if(watch.elapsed() > 1.95){ break; }
    }
    for(int i = 0; i < n; i++){
        cout << st.getVal(i) << ' ';
    }
    cout << '\n';
}


Measured memory_bytes: 20916