辞書を使うと簡単かも。
abc208c.py
def solv():
N,K = map(int,input().split())
A = list(map(int,input().split()))
dic = {}
for i in range(N):
dic[A[i]] = K//N
A.sort()
for j in range(K%N):
dic[A[j]] += 1
for key in dic.keys():
print(dic[key])
solv()#302ms
配列を使った場合の記述もできた方がいいかも
abc208c.py
def solv():
N,K = map(int,input().split())
A = list(map(int,input().split()))
lis = []
for i,a in enumerate(A,1):
lis.append([i,a,K//N])
lis = sorted(lis,key=lambda t:t[1])
for j in range(K%N):
lis[j][2] += 1
lis = sorted(lis,key=lambda t:t[0])
for a,b,c in lis:
print(c)
solv()#492ms