Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(100, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        for index in range(left, right+1):
            B[index] += 1
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for k in range(K):
    flag_all = True
    for i in range(N):
        if A[i] != N:
            flag_all = False
    if flag_all:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        for j in range(-d, d+1):
            index = i + j
            if 0 <= index < N:
                B[index] += 1
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for k in range(K):
    flag_all = True
    for i in range(N):
        if A[i] != N:
            flag_all = False
    if flag_all:
        break
        
    B = [0] * N
    for i in range(N):
        d = A[i]
        for j in range(-d, d+1):
            index = i + j
            if 0 <= index < N:
                B[index] += 1
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))

Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int, input().split())
A = list(map(int, input().split()))

for k in range(K):
    B = [0] * N
    for i in range(N):
        d = A[i]
        for j in range(-d, d+1):
            index = i + j
            if 0 <= index < N:
                B[index] += 1
    A = B
print(" ".join(map(str, A)))


Fixed submission:
N, K = map(int, input().split())
A = list(map(int, input().split()))
K = min(50, K)

for k in range(K):
    for i in range(N):
        if A[i] != N:
            break
    else:
        break

    B = [0] * N
    for i in range(N):
        d = A[i]
        left = max(0, i - d)
        right = min(N-1, i + d)
        B[left] += 1
        if right + 1 < N:
            B[right+1] -= 1
    for i in range(1, N):
        B[i] += B[i-1]
    A = B
print(" ".join(map(str, A)))