N,M = map(int,input().split()) W = list(map(int,input().split())) m = sum(W) W = [i*M for i in W] print(*[W[i]//m for i in range(N)])