N,M = map(int,input().split())
W = list(map(int,input().split()))
A = [0]*N
if M!=0:
    w = sum(W)/M
    for i in range(N):
        A[i] = round(W[i]/w)
print(*A)