"use strict";

const main = arg => {
    const inputList = arg.trim().split("\n");
    // 回答を記述
    const N = parseInt(inputList[0].split(" ")[0]);
    const K = parseInt(inputList[0].split(" ")[1]);
    let ALightList = inputList[1].split(" ").map(ele => parseInt(ele));

    const changeSumList = Array(ALightList.length).fill(0);
    for (let j = 0; j < ALightList.length; j++) {
        const minus = (j - ALightList[j]) < 0 ? 0 : j - ALightList[j];
        const plus = j + ALightList[j] > N ? N : j + ALightList[j];
        for (let k = minus; k <= plus; k++) {
            if (changeSumList[k] < N) {
                changeSumList[k]++;
            }
        }
    }
    ALightList = changeSumList;
    console.log(ALightList.join(" "))
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));