N,M = map(int,input().split()) lsW = list(map(int,input().split())) sumW = sum(lsW) print(*[lsW[i]*M//(sumW) for i in range(N)])