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