n,m=map(int,input().split()) w=list(map(int,input().split())) s=sum(w) a=[0]*n if s==0: print(*a) else: for i in range(n): w[i]*=m a[i]=w[i]//s print(*a)