""" """ import sys from sys import stdin N,M = map(int,stdin.readline().split()) W = list(map(int,stdin.readline().split())) #H = sum(W) / M S = sum(W) if S == 0: ans = [0 for i in W] else: ans = [i * M // S for i in W] print (*ans)