n,m = map(int,input().split()) w = list(map(int,input().split())) sum_w = sum(w) print(" ".join([str(m * w[i] // sum_w) for i in range(n)]))