def solvewa(n, m, w): a = [0] * n if m == 0: return a w_one = sum(w) / m for i in range(n): a[i] = int(w[i] / w_one) return a def solveac(n, m, w): from fractions import Fraction w_one = Fraction(sum(w), m) a = [0] * n 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(*solvewa(n,m,w))