Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(k > log2(n)):
    for i in range(n):
        print(n,end=" ")

else:
    for j in range(k):
        b = [0]*n
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n-1,a[i]+i)
            b[l] += 1
            if(r+1<n):
                b[r+1] -= 1
        for i in range(1,n):
            b[i] += b[i-1]
        a = b


    for i in a:
        print(i,end=" ")


Fixed submission:
from math import log2
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(k > 10*log2(n) + 1):
    for i in range(n):
        print(n,end=" ")

else:
    for j in range(k):
        b = [0]*n
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n-1,a[i]+i)
            b[l] += 1
            if(r+1<n):
                b[r+1] -= 1
        for i in range(1,n):
            b[i] += b[i-1]
        a = b


    for i in a:
        print(i,end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(n<k):
    for i in range(n):
        print(n,end=" ")

for j in range(k):
    b = [0]*n
    for i in range(n):
        l = max(0,i-a[i])
        r = min(n-1,a[i]+i)
        b[l] += 1
        if(r+1<n):
            b[r+1] -= 1
    for i in range(1,n):
        b[i] += b[i-1]
    a = b


for i in a:
    print(i,end=" ")


Fixed submission:
from math import log2
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(k > 10*log2(n) + 1):
    for i in range(n):
        print(n,end=" ")

else:
    for j in range(k):
        b = [0]*n
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n-1,a[i]+i)
            b[l] += 1
            if(r+1<n):
                b[r+1] -= 1
        for i in range(1,n):
            b[i] += b[i-1]
        a = b


    for i in a:
        print(i,end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))

def calc(a):
    for t in range(k):
        b = [0] * n
        for i in range(n):
            for j in range(n):
                if a[j] >=  abs(j - i):
                    b[i] += 1

        for i in range(n):
            if(max(n-i,i) > b[i]):
                break
            for j in range(n):
                a[j] += n *(k-t)
            return a
        a = b
    return a

a = calc(a)
for i in a:
    print(i,end=" ")
        

Fixed submission:
from math import log2
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(k > 10*log2(n) + 1):
    for i in range(n):
        print(n,end=" ")

else:
    for j in range(k):
        b = [0]*n
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n-1,a[i]+i)
            b[l] += 1
            if(r+1<n):
                b[r+1] -= 1
        for i in range(1,n):
            b[i] += b[i-1]
        a = b


    for i in a:
        print(i,end=" ")

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
a = list(map(int,input().split()))

def calc(a):
    for t in range(k):
        b = [0] * n
        for i in range(n):
            for j in range(n):
                if a[j] >=  abs(j - i):
                    b[i] += 1

        for i in range(n):
            if(max(n-i,i) > b[i]):
                break
            print("oh")
            for j in range(n):
                a[j] += n *(k-t)
            return a
        a = b
    return a

a = calc(a)
for i in a:
    print(i,end=" ")
        

Fixed submission:
from math import log2
n,k = map(int,input().split())
a = list(map(int,input().split()))
b = [0]*n

if(k > 10*log2(n) + 1):
    for i in range(n):
        print(n,end=" ")

else:
    for j in range(k):
        b = [0]*n
        for i in range(n):
            l = max(0,i-a[i])
            r = min(n-1,a[i]+i)
            b[l] += 1
            if(r+1<n):
                b[r+1] -= 1
        for i in range(1,n):
            b[i] += b[i-1]
        a = b


    for i in a:
        print(i,end=" ")