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