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