r=require("fs").readFileSync("/dev/stdin","utf8").split("\n");
[n,k]=r[0].split(" ");
a=r[1].split(" ");
for(;k--;){
    c=[];
    for(x in a){
        c[x]=0;
        for(y in a){
            if(Math.abs(x-y)<=a[y])c[x]++;
        }
    }
    a=c.slice(0);
}