Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(50, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(42, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(k):
    next = [1]*n
    stack = 0
    for j, v in enumerate(current):
        next[j] += stack % 10
        stack //= 10
        if v > 0:
            stack += int('1'*v)
    stack = 0
    for j in range(n-1, -1, -1):
        next[j] += stack % 10
        stack //= 10
        if current[j] > 0:
            stack += int('1' * current[j])
    current = next
print(*current)

Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(42, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)

Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(k):
    next = [1]*n
    stack = 0
    for j, v in enumerate(current):
        next[j] += int(str(stack)[-1])
        stack = str(stack)
        stack = stack[:len(stack)-1]
        if len(stack):
            stack = int(stack)
        else:
            stack = 0
        if v > 0:
            stack += int('1'*v)
    stack = 0
    for j in range(n-1, -1, -1):
        next[j] += int(str(stack)[-1])
        stack = str(stack)
        stack = stack[:len(stack) - 1]
        if len(stack):
            stack = int(stack)
        else:
            stack = 0
        if current[j] > 0:
            stack += int('1' * current[j])
    current = next
print(*current)


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(42, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(k):
    next = [1]*n
    stack = 0
    for j, v in enumerate(current):
        next[j] += int(str(stack)[-1])
        stack = str(stack)
        stack = stack[:len(stack)-1]
        if len(stack):
            stack = int(stack)
        else:
            stack = 0
        if v > 0:
            stack += int('1'*v)
    stack = 0
    next = next[::-1]
    for j, v in enumerate(current[::-1]):
        next[j] += int(str(stack)[-1])
        stack = str(stack)
        stack = stack[:len(stack) - 1]
        if len(stack):
            stack = int(stack)
        else:
            stack = 0
        if v > 0:
            stack += int('1' * v)
    current = next[::-1]
print(*current)


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(42, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)

Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(k):
    next = np.array([0]*n)
    for j, v in enumerate(current):
        c = np.array([1 if j-v <= k <= j+v else 0 for k in range(n)])
        next += c
    current = next
print(*next)


Fixed submission:
n, k = map(int, input().split())
a = list(map(int, input().split()))
current = a[:]
for _ in range(min(42, k)):
    nex = [0]*n
    for i, v in enumerate(current):
        l = max(0, i-v)
        r = min(n-1, i+v)
        nex[l] += 1
        if r+1 < n:
            nex[r+1] -= 1
    for i in range(1, n):
        nex[i] += nex[i-1]
    current = nex

print(*current)