def solveac(n, m, w): a = [0] * n if m == 0: return a from fractions import Fraction w_one = Fraction(sum(w), m) for i in range(n): a[i] = int(Fraction(w[i], w_one)) return a n, m = map(int,input().split()) w = list(map(int,input().split())) print(*solveac(n, m, w))