N, M = map(int, input().split()) W = list(map(int, input().split())) if M: sum_ = sum(W) A = [] for w_i in W: A.append(M*w_i//sum_) else: A = [0]*N print(*A)