Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    if i-light[i]>0:
      l=i-light[i]
    else:
      l=0
    if i+light[i]<N-1:
      r=i+light[i]+1
    else:
      r=N
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for j in range(1,N):
    imo[j]+=imo[j-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    kido=light[i]
    imo[max(0,i-kido)]+=1
    imo[min(N-1,i+kido)+1]-=1
    
  for j in range(1,N):
    imo[j]+=imo[j-1]
  if light[:]==imo[:-1]:
    break
  else:
    light=imo[:-1]
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
copy=[0]*N
for k in range(K):
  imo=[0]*(N+1)
  x=0
  for i in range(N):
    kido=light[i]
    imo[max(0,i-kido)]+=1
    imo[min(N-1,i+kido)+1]-=1
  for j in range(N):
    x+=imo[j]
    copy[j]=x
  if light==copy:
    break
  else:
    light=copy[:]
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
light=list(map(int,input().split()))
copy=[0]*N
for k in range(K):
  imo=[0]*(N+1)
  x=0
  for i in range(N):
    kido=light[i]
    imo[max(0,i-kido)]+=1
    imo[min(N-1,i+kido)+1]-=1
  for j in range(N+1):
    x+=imo[j]
    copy[j]=x
  if light==copy:
    break
  else:
    light=copy
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  x=0
  for i in range(N):
    kido=light[i]
    imo[max(0,i-kido)]+=1
    imo[min(N-1,i+kido)+1]-=1
  for j in range(N):
    x+=imo[j]
    light[j]=x
  if N==min(light):
    break
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

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

for k in range(K):
  copy=[0]*N
  for i in range(N):
    kido=light[i]
    smin=max(0,i-kido)
    smax=min(N-1,i+kido)
    for j in range(smin, smax+1):
      copy[j]+=1
  light=copy
  if N==min(light):
    break
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

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

for k in range(K):
  copy=[0]*N
  for i in range(N):
    kido=light[i]
    smin=max(0,i-kido)
    smax=min(N-1,i+kido)
    for j in range(smin, smax+1):
      copy[j]+=1
  light=copy
  if N==min(light):
    break
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])

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

for k in range(K):
  copy=[0]*N
  for i in range(N):
    kido=light[i]
    smin=max(0,i-kido)
    smax=min(N-1,i+kido)
    for j in range(smin, smax+1):
      copy[j]+=1
  light=copy
print(*light)

Fixed submission:
N,K=map(int,input().split())
light=list(map(int,input().split()))
for k in range(K):
  imo=[0]*(N+1)
  for i in range(N):
    l=max(0,i-light[i])
    r=min(N-1,i+light[i])+1
    imo[l]+=1
    imo[r]-=1
  for i in range(1,N):
    imo[i]+=imo[i-1]
  if light==imo:
    break
  else:
    light=imo[:]
print(*light[:-1])