N,M = map(int,input().split()) lsW = list(map(int,input().split())) sumW = sum(lsW) if M == 0: print(*[0]*N) else: print(*[lsW[i]*M//(sumW) for i in range(N)])