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

for i in range(k):
    b =  [0] * n
    for j in range(n):
        d = a[j] + 0.5
        for l in range(int(d)):
            if j + l + 1 < n:
                b[j + l + 1] += 1
            if j - l - 1 >= 0:
                b[j - l - 1] += 1
    #print('ans')
    #print(list(x + y for x, y in zip([1] * n, b)))
    a = list(x + y for x, y in zip([1] * n, b))
print(*a, sep=' ')

Fixed submission:
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')

Buggy python submission (verdict: Time Limit Exceeded):
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')

Fixed submission:
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')

Buggy python submission (verdict: Time Limit Exceeded):
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')

Fixed submission:
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')

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

for i in range(k):
    b =  [0] * n
    for j in range(n):
        d = a[j] + 0.5
        for l in range(int(d)):
            if j + l + 1 < n:
                b[j + l + 1] += 1
            if j - l - 1 >= 0:
                b[j - l - 1] += 1
    #print('ans')
    #print(list(x + y for x, y in zip([1] * n, b)))
    a = list(x + y for x, y in zip([1] * n, b))
print(*a, sep=' ')

Fixed submission:
import copy

n, k = map(int, input().split())
a = list(map(int, input().split()))

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

    for j in range(n):
        b[j + 1] += b[j]
    b = b[:-1]

    if b == a:
        break
    a = copy.deepcopy(b)
print(*a, sep=' ')