from decimal import Decimal N, M = map(Decimal, input().split()) W = list(map(Decimal, input().split())) sumW = sum(W) wb = Decimal(sumW / M) ans = [0] * int(N) for i in range(int(N)): ans[i] = int(Decimal(W[i] / wb)) print(*ans)