Language: Java

import java.util.*;

public class Main {

	public static void main(String[] args) throws IOException {
		
		FastReader in = new FastReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int n = in.nextInt();
		int k = in.nextInt();
		int[] a = in.nextIntArray(n);

		for (int i = 0; i < Math.min(k, 100); ++i) {
			int[] b = new int[n];
			for (int j = 0; j < n; ++j) {
				int l = Math.max(0, j - a[j]);
				int r = Math.min(n - 1, j + a[j]);
				b[l]++;
				if (r + 1 < n)
					b[r + 1]--;
			}
			a = b.clone();
			for (int x = 1; x < n; ++x) {
				a[x] += a[x - 1];
			}

		}

		StringBuilder res = new StringBuilder();

		for (int i = 0; i < n; i++) {
			res.append(a[i] + " ");
		}
		out.println(res.toString());
		out.flush();
		out.close();
	}

	static class FastReader {
		StringTokenizer st;
		BufferedReader br;

		public FastReader(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public FastReader(FileReader fileReader) {
			br = new BufferedReader(fileReader);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			int[] ret = new int[n];
			for (int i = 0; i < n; i++) {
				ret[i] = nextInt();
			}
			return ret;
		}

		public long[] nextIntLong(int n) throws IOException {
			long[] ret = new long[n];
			for (int i = 0; i < n; i++) {
				ret[i] = nextLong();
			}
			return ret;
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}

Compiler output:
Main.java:5: error: cannot find symbol
	public static void main(String[] args) throws IOException {
	                                              ^
  symbol:   class IOException
  location: class Main
Main.java:41: error: cannot find symbol
		BufferedReader br;
		^
  symbol:   class BufferedReader
  location: class FastReader
Main.java:43: error: cannot find symbol
		public FastReader(InputStream s) {
		                  ^
  symbol:   class InputStream
  location: class FastReader
Main.java:47: error: cannot find symbol
		public FastReader(FileReader fileReader) {
		                  ^
  symbol:   class FileReader
  location: class FastReader
Main.java:51: error: cannot find symbol
		public String next() throws IOException {
		                            ^
  symbol:   class IOException
  location: class FastReader
Main.java:57: error: cannot find symbol
		public int nextInt() throws IOException {
		                            ^
  symbol:   class IOException
  location: class FastReader
Main.java:61: error: cannot find symbol
		public int[] nextIntArray(int n) throws IOException {
		                                        ^
  symbol:   class IOException
  location: class FastReader
Main.java:69: error: cannot find symbol
		public long[] nextIntLong(int n) throws IOException {
		                                        ^
  symbol:   class IOException
  location: class FastReader
Main.java:77: error: cannot find symbol
		public double nextDouble() throws IOException {
		                                  ^
  symbol:   class IOException
  location: class FastReader
Main.java:81: error: cannot find symbol
		public long nextLong() throws IOException {
		                              ^
  symbol:   class IOException
  location: class FastReader
Main.java:85: error: cannot find symbol
		public String nextLine() throws IOException {
		                                ^
  symbol:   class IOException
  location: class FastReader
Main.java:89: error: cannot find symbol
		public boolean ready() throws IOException {
		                              ^
  symbol:   class IOException
  location: class FastReader
Main.java:7: error: reference to FastReader is ambiguous
		FastReader in = new FastReader(System.in);
		                ^
  both constructor FastReader(InputStream) in FastReader and constructor FastReader(FileReader) in FastReader match
Main.java:8: error: cannot find symbol
		PrintWriter out = new PrintWriter(System.out);
		^
  symbol:   class PrintWriter
  location: class Main
Main.java:8: error: cannot find symbol
		PrintWriter out = new PrintWriter(System.out);
		                      ^
  symbol:   class PrintWriter
  location: class Main
Main.java:44: error: cannot find symbol
			br = new BufferedReader(new InputStreamReader(s));
			         ^
  symbol:   class BufferedReader
  location: class FastReader
Main.java:44: error: cannot find symbol
			br = new BufferedReader(new InputStreamReader(s));
			                            ^
  symbol:   class InputStreamReader
  location: class FastReader
Main.java:48: error: cannot find symbol
			br = new BufferedReader(fileReader);
			         ^
  symbol:   class BufferedReader
  location: class FastReader
18 errors