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