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