#![allow(non_snake_case,unused_imports,dead_code)]
use std::io::Read;
use std::cmp::max;
use std::cmp::min;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BinaryHeap;
use std::cmp::Ordering;

fn comp_f64(a: &f64, b: &f64) -> Ordering {
    if a < b {
        return Ordering::Less;
    } else if a > b {
        return Ordering::Greater;
    }
    Ordering::Equal
}

fn main() {

    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut buf_it = buf.split_whitespace();


    let N = buf_it.next().unwrap().parse::<usize>().unwrap();
    let K = buf_it.next().unwrap().parse::<usize>().unwrap();

    let A = (0..N).map(|_| buf_it.next().unwrap().parse::<isize>().unwrap()).collect::<Vec<_>>();

    let mut B = A.iter().map(|&a| a).collect::<Vec<_>>();
    let B_INF = (0..N).map(|i| min(max(i,N-i)+10,N) as isize).collect::<Vec<_>>();
    let mut cnt_INF = 0;
    let mut I = (0..N).collect::<HashSet<_>>();
    for _ in 0..(K-1){
        if cnt_INF == N as isize { break;}
        let mut T = SegmentTree::new(N,|x,y| x+y,0);
        for &i in &I{
            let a = B[i];
            let l = max(0,i as isize -a) as usize;
            let r = min(N,i+a as usize +1);
            T.set(l,r,1);
        }
        let mut i_POP = Vec::new();
        for &i in &I{
            B[i] = T.get(i) + cnt_INF;
            if B[i] >= B_INF[i]{
                i_POP.push(i);
            }
        }
        for &i in &i_POP{
            I.remove(&i);
            cnt_INF += 1;
        }
    }
    
    let mut T = SegmentTree::new(N,|x,y| x+y,0);
    for i in 0..N{
        let a = B[i];
        let l = max(0,i as isize -a) as usize;
        let r = min(N,i+a as usize +1);
        T.set(l,r,1);
    }
    for i in 0..N{
        B[i] = T.get(i);
    }
    for b in &B{
        println!("{}",b);
    }

}

struct SegmentTree<N,F>
where F:Fn(N,N) ->N{
//モノイドが乗るセグ木(区間更新一点取得)
    n: usize,
    T: Vec<N>,
    func: F,
    identity: N,
}

impl<N:Copy,F> SegmentTree<N,F>
where F:Fn(N,N) ->N {
    fn new(n:usize,func:F,identity:N) -> SegmentTree<N,F>{
        let mut T = SegmentTree { n:n,T:Vec::new(),func:func,identity:identity};
        T.init();
        T
    }
    fn init(&mut self){
        self.n = 1<<format!("{:b}",self.n-1).len();
        self.T = (0..(2*self.n-1)).map(|_| self.identity).collect();
    }
    fn get(&mut self,index:usize) -> N{
        let i = index + self.n - 1;
        self._get(i)
    }
    fn _get(&mut self,i:usize) -> N{
        let n = self.T[i];
        if i==0{return n;}
        let m = self._get((i-1)/2);
        (self.func)(n,m)
    }
    fn set(&mut self,l:usize,r:usize,value:N){
        let n = self.n;
        self._set(l,r,value,0,0,n);
    }
    fn _set(&mut self,l:usize,r:usize,value:N,i:usize,a:usize,b:usize){
        if l==a && b==r{
            let v = self.T[i];
            let v = (self.func)(v,value);
            self.T[i] = v;
            return;
        }
        let j = (a+b)/2;
        if l<j{
            self._set(l,min(r,j),value,2*i+1,a,j);
        }
        if j<r{
            self._set(max(l,j),r,value,2*i+2,j,b);
        }
    }
}

Measured memory_bytes: 16208