n,m = map(int,input().split()) W = list(map(int,input().split())) s = sum(W) ans = [] for i in range(n): w = W[i]*m ans.append(w//s) print(*ans)