N,M = list(map(int,input().split())) W = list(map(int,input().split())) s = sum(H) for i in range(N): print(W[i] * M // s,end=' ') print()