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