//{{{
#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 l = -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 st, int lt, const vector<int>& data): left(st), right(lt){
        if(left == right){
            l = -1;
            value = data[left];
        }else{
            l = sts.size();
            sts.push_back({});
            sts.push_back({});
            sts[l] = SegTree(left, (right - left) / 2 + left, data);
            sts[l + 1] = SegTree((right - left) / 2 + left + 1, right, data);
        }
    }
    void setAll(int num){
        if(l >= 0){
            sts[l].setAll(num);
            sts[l + 1].setAll(num);
        }
        value = num;
    }
    void add(int st, int lt, int val){
        if(right < st || lt < left){ return; }
        if(st <= left && right <= lt){
            value += val;
        }else{
            sts[l].add(st, lt, val);
            sts[l + 1].add(st, lt, val);
        }
    }
	int getVal(int idx){
        if(right < idx || idx < left){ return 0; }
        return value + (l >= 0 ? sts[l].getVal(idx) + sts[l + 1].getVal(idx) : 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: 20784