N,M = map(int,input().split()) W = list(map(int,input().split())) sumW = sum(W) ans = [0 for _ in range(N)] for i in range(N): if sumW == 0: continue ans[i] = W[i] * M // sumW print(*ans)