// clang-format off
	#include <bits/stdc++.h>
	using namespace std; using ll = long long; using uint = unsigned int;
	#define SFINAE(x, ...)	template <class, class = void> struct x : false_type {}; template <class T> struct x<T, void_t<__VA_ARGS__>> : true_type {};
	SFINAE(DefaultIO, decltype(cout << declval<T &>()))
	SFINAE(IsTuple, typename tuple_size<T>::type)
	SFINAE(Iterable, decltype(begin(declval<T>())))
	template <class T> constexpr char Space(const T &) { return (Iterable<T>::value or IsTuple<T>::value) ? '\n' : ' '; }
	template <auto &os> struct Writer {
		template <class T> void Impl(T const &t) const {
			if constexpr (DefaultIO<T>::value) os << t;
			else if constexpr (Iterable<T>::value) { int i = 0; for (auto &x : t) ((i++) ? (os << Space(x), Impl(x)) : Impl(x)); }
			else if constexpr (IsTuple<T>::value) apply([this](auto const &... args) { int i = 0; (((i++) ? (os << ' ', Impl(args)) : Impl(args)), ...);}, t);
			else static_assert(IsTuple<T>::value, "No matching type for print");
		}
		template <class F, class... Ts> auto &operator()(F const &f, Ts const &... ts) const { return Impl(f), ((os << ' ', Impl(ts)), ...), os << '\n', *this; }
	};
	template <auto &is> struct Reader {
		template <class T> auto& operator()(T &t) const {
			if constexpr (DefaultIO<T>::value) is >> t;
			else if constexpr (Iterable<T>::value) for (auto &x : t) (*this)(x);
			else if constexpr (IsTuple<T>::value) apply([this](auto &... args) { ((*this)(args), ...); }, t);
			else static_assert(IsTuple<T>::value, "No matching type for read");
			return *this;
		}
	};
	#ifdef NARUT_LOCAL
	#define Debug(...) cerr << "\033[0;31m", Writer<cerr>{}(__VA_ARGS__), cerr << "\033[0m\n"
	#else
	#define Debug(...) 0
	#endif
	[[maybe_unused]] constexpr Reader<cin> Cin; [[maybe_unused]] constexpr Writer<cout> Cout;
	#define FOR(i, j, n) for (int i = int(j); i < int(n); ++i)
	#define ROF(i, j, n) for (int i = int(n) - 1; i >= int(j); --i)
// clang-format on


// auto rmq = RangeUpdate<int>(v.begin(), v.end());
template <class T> struct RangeUpdate {
	uint sz = 0;
	std::vector<T> tree;

	RangeUpdate() = default;
	RangeUpdate(uint n) : sz(getSz(n)), tree(sz + n) {}
	template <class It> RangeUpdate(It first, It last) : sz(getSz(last - first)) {
		tree.reserve(2 * sz), tree.resize(sz);
		tree.insert(tree.end(), first, last);
	}

	void UpdateExc(uint l, uint r, T const &t) { // [l, r)
		for (l += sz, r += sz; l < r; l /= 2, r /= 2) {
			if (l % 2) tree[l] = tree[l] + t, l++;
			if (r % 2) r--, tree[r] = tree[r] + t;
		}
	}

	void UpdateInc(uint l, uint r, T const &t) { UpdateExc(l, r + 1, t); }

	T Query(uint u) const {
		u += sz;
		auto ans = tree[u];
		for (u /= 2; u > 0; u /= 2) ans = ans + tree[u];
		return ans;
	}

	static uint getSz(uint n) {
		if (n < 2) return 1;
		return 1u << (sizeof(uint) * 8 - __builtin_clz(n - 1));
	}

  private:
	friend ostream &operator<<(ostream &os, RangeUpdate const &ru) {
		for (uint u = 0; u < ru.sz; ++u) os << ru.Query(u) << ' ';
		return os << '\n';
	}
};




auto Main() {
	int n, k;
	cin>>n>>k;
	vector<int> A(n), B(n);
	Cin(A);

	FOR(ki,0,k) {
		auto rmq = RangeUpdate<int>(n);
		FOR(j,0,n) {
			int a = A[j];
			rmq.UpdateInc(max(0,j-a), min(n-1,j+a), 1);
		}
		FOR(j,0,n) B[j]=rmq.Query(j);
		if(A==B) break;
		swap(A,B);
	}
	Cout(A);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout << fixed << setprecision(10);
#ifdef NARUT_LOCAL
	assert(freopen("io/test.in", "r", stdin));
	cin.exceptions(cin.badbit | cin.failbit);
	cerr << fixed << setprecision(10);
#endif

	Main();
}


Measured memory_bytes: 6628