n,m=map(int,input().split()) w=list(map(int,input().split())) g=sum(w) s=g/m ans=[] for i in w: ans.append(m*i//g) print(*ans)