Buggy python submission (verdict: Time Limit Exceeded):
n,k,*a=map(int,open(0).read().split())
for _ in range(k):
  b=[0]*n
  for i,q in enumerate(a):
    b[max(0,i-q)]+=1
    if i+q+1<n:
      b[i+q+1]-=1
  for i in range(1,n):
    b[i]+=b[i-1]
  if a==b:
    break
  a=b[:]
print(*a)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
n,k,*a=map(int,open(0).read().split())
for _ in range(min(k,99)):
  b=[0]*n
  for i,q in enumerate(a):
    b[max(0,i-q)]+=1
    if (r:=i+q+1)<n:
      b[r]-=1
  for i in range(1,n):
    b[i]+=b[i-1]
  a=b[:]
print(*a)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
def LI():return list(map(int,input().split()))
def yes():print("YES")
def no():print("NO")

n,k=LI()
a=LI()

import numpy as np


for _ in range(k):
    tab=[0]*(n+1)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q<=n-1:
            tab[i+q+1]-=1
        else:
            tab[n-1+1]-=1
    
    b=np.cumsum(tab)[:n]
    # print(tab,b)
    a=b[:]
print(*a)


Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
def LI():return list(map(int,input().split()))
def yes():print("YES")
def no():print("NO")

n,k=LI()
a=LI()

if k>10**4 or k>=n:
    ans=[n]*n
    print(*ans)
    exit()


for _ in range(k):
    b=[0]*n
    for i in range(n):
        q=a[i]
        for j in range(i-q,i+q+1):
            if 0<=j<=n-1:
                b[j]+=1
    a=b[:]
print(*a)


Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Runtime Error):
n,k=LI()
a=LI()

print(*[n]*n)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
def LI():return list(map(int,input().split()))

n,k=LI()
import numpy as np
a=np.array(LI(),dtype=np.int32)

while k>0:
    b=np.zeros(n,dtype=np.int32)
    for i in range(n):
        b[max(0,i-(a[i])):min(n-1,i+(a[i]))+1]+=1
    a=b
    k-=1
print(*a)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
def LI():return list(map(int,input().split()))
def yes():print("YES")
def no():print("NO")
import time
t1=time.time()
n,k=LI()
a=LI()

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


for _ in range(k):
    b=[0]*n
    for i in range(n):
        q=a[i]
        for j in range(i-q,i+q+1):
            if 0<=j<=n-1:
                b[j]+=1
    a=b[:]
    t2=time.time()
    if t2-t1>1800:
        print(*a)
        exit()
print(*a)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)

Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!
def LI():return list(map(int,input().split()))
def yes():print("YES")
def no():print("NO")

n,k=LI()
a=LI()

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


for _ in range(k):
    b=[0]*n
    for i in range(n):
        q=a[i]
        for j in range(i-q,i+q+1):
            if 0<=j<=n-1:
                b[j]+=1
    a=b[:]
    # print(_,a)
print(*a)

Fixed submission:
# coding: utf-8
# Your code here!
import time
t1=time.time()
def LI():return list(map(int,input().split()))
n,k=LI()
a=LI()

for _ in range(k):
    tab=[0]*(n)
    for i in range(n):
        q=a[i]
        if 0<=i-q:
            tab[i-q]+=1
        else:
            tab[0]+=1
        if i+q+1<=n-1:
            tab[i+q+1]-=1
        else:
            pass
    b=[tab[0]]
    for i in range(n-1):
        b.append(tab[i+1]+b[-1])
    a=b[:]
    if time.time()-t1>1.5:
        print(*a)
        exit()
print(*a)