N,M=map(int,input().split()) W=list(map(int,input().split())) W_sum=sum(W) A=[(M*w)//W_sum for w in W] print(*A)