from fractions import Fraction N, M = map(int, input().split()) W = list(map(int, input().split())) S = sum(W) w = Fraction(S, M) ans = [0]*N for i in range(N): ans[i] = int(W[i]/w) print(*ans)