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

def input():
    return sys.stdin.readline()[:-1]


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

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

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


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

if k>=42:
    print(*[n]*n)
    exit()

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

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

def input():
    return sys.stdin.readline()[:-1]


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

for _ in range(k):
    b_li = [0 for _ in range(n)]
    for i in range(n):
        l = max(0, i-a_li[i])
        r = min(n-1, i+a_li[i])
        for j in range(l, r+1):
            b_li[j] += 1
    a_li = b_li
    
print(' '.join(map(str, a_li)))

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


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

if k>=42:
    print(*[n]*n)
    exit()

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

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np

def input():
    return sys.stdin.readline()[:-1]


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

for _ in range(k):
    b_li = [0 for _ in range(n)]
    for i in range(n):
        l = max(0, i-a_li[i])
        r = min(n-1, i+a_li[i])
        for j in range(l, r+1):
            b_li[j] += 1
    a_li = b_li
    
print(' '.join(map(str, a_li)))

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


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

if k>=42:
    print(*[n]*n)
    exit()

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

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

def input():
    return sys.stdin.readline()[:-1]

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

for _ in range(k):
    tmp_li = [y for i, x in enumerate(a_li) for y in range(max(0, i-x), min(i+x+1, n), 1)]
    a_li = [tmp_li.count(i) for i in range(n)]
print(' '.join(map(str, a_li)))

Fixed submission:
import sys

def input():
    return sys.stdin.readline()[:-1]


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

if k>=42:
    print(*[n]*n)
    exit()

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