Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

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

for i in range(K):
  data = [0]*N
  for j in range(N):
    if j-List[j] < 0:
      data[0] += 1
    else:
      data[j-List[j]] += 1
    if j+List[j]+1 < N:
      data[j+List[j]+1] +=-1
  List[0] = data[0]
  for j in range(N-1):
    List[j+1] = List[j] + data[j+1]
  if List.count(N) == N:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Runtime Error):
N,K=map(int,input().split())
List = list(map(int, input().split()))

for i in range(K):
  Flag = False
  data = [0]*N
  for j in range(N):
    if i-List[i] < 0:
      i-List[i] = 0
    data[i-List[i]] += 1
    if i+List[i]+1 < N:
      data[i+List[i]+1] +=-1
  List[0] = data[0]
  for j in range(N-1):
    List[i+1] = List[i] + data[i+1]
  if List.count(N) == N:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki

for i in range(K):
  data = [0]*N
  ruiseki = [0]*N
  for i in range(N):
    first = i-List[i]
    last = i+List[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < N:
      data[last+1] +=-1
  List[0] = data[0]
  for i in range(N-1):
    List[i+1] = List[i] + data[i+1]
  if List.count(N) == N:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

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

for i in range(K):
  Flag = False
  data = [0]*N
  ruiseki = [0]*N
  for i in range(N):
    first = i-List[i]
    last = i+List[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < N:
      data[last+1] +=-1
  List[0] = data[0]
  for i in range(N-1):
    List[i+1] = List[i] + data[i+1]
  if List.count(N) == N:
      Flag = True
  if Flag:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

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

def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki

for i in range(K):
  Flag = False
  List = imosu(List,N)
  if List.count(N) == N:
      Flag = True
  if Flag:
    break
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
data_x = [0]*N
res = [0]*N

def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  return data

def ruiseki_f(y, k):
  ruiseki = [0]*k
  ruiseki[0] = y[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + y[i+1]
  return ruiseki

for i in range(K):
  Flag = False
  data_x = imosu(List,N)
  List = ruiseki_f(data_x,N)
  if List.count(N) == N:
      Flag = True
  #print(Flag)
  if Flag:
    break
res = List
print(*res)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
data_x = [0]*N
res = [0]*N

def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  return data

def ruiseki_f(y, k):
  ruiseki = [0]*k
  ruiseki[0] = y[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + y[i+1]
  return ruiseki

for i in range(K):
  Flag = True
  data_x = imosu(List,N)
  List = ruiseki_f(data_x,N)
  for j in range(N):
    if not List[j] == N:
      Flag = False
  if Flag:
    break
res = List
print(*res)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
data_x = [0]*N
res = [0]*N

def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  return data

def ruiseki_f(y, k):
  ruiseki = [0]*k
  ruiseki[0] = y[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + y[i+1]
  return ruiseki

for i in range(K):
  data_x = imosu(List,N)
  List = ruiseki_f(data_x,N)
  for j in range(N):
    Flag = True
    if not List[j] == N:
      Flag = False
  if Flag:
    break
res = List
print(*res)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
data_x = [0]*N
res = [0]*N

def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  return data

def ruiseki_f(y, k):
  ruiseki = [0]*k
  ruiseki[0] = y[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + y[i+1]
  return ruiseki

for i in range(K):
  data_x = imosu(List,N)
  List = ruiseki_f(data_x,N)
  for j in range(N):
    if List[j] == N:
      break
res = List
print(*res)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
strength = [1]*N
for k in range (K):
  for i in range(N):
    if List[i] == 0:
      pass
    else:
      for j in range(1,List[i]+1):
        if i-j<0 and (i+j > N or i + j == N):
          pass
        elif i-j<0 and i+j <N:
          strength[i+j] += 1
        elif i-j>=0 and (i+j > N or i + j == N):
          strength[i-j] += 1
        else:
          strength[i-j] += 1
          strength[i+j] += 1
      #print(List,strength)
  List = strength
  strength = [1]*N
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)

Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
List = list(map(int, input().split()))
strength = [1]*N
for k in range (K):
  for i in range(N):
    for j in range(N):
      if i==j:
        pass
      else:
        if j-List[j]-0.5 < i < List[j]+j+0.5:
          strength[i] += 1
        else:
          pass
      #print(List,strength)
  List = strength
  strength = [1]*N
print(*List)

Fixed submission:
N,K=map(int,input().split())
List = list(map(int, input().split()))
 
def imosu(x,k):
  data = [0]*k
  for i in range(k):
    first = i-x[i]
    last = i+x[i]
    if first < 0:
      first = 0
    data[first] += 1
    if last+1 < k:
      data[last+1] +=-1
  ruiseki = [0]*k
  ruiseki[0] = data[0]
  for i in range(k-1):
    ruiseki[i+1] = ruiseki[i] + data[i+1]
  return ruiseki
 
for i in range(K):
  List = imosu(List,N)
  if List.count(N) == N:
    break
print(*List)