import decimal N, M = map(lambda x: decimal.Decimal(x), input().split()) W = list(map(lambda x:decimal.Decimal(x), input().split())) if M == 0: print(*[0 for _ in range(int(N))]) exit() total_weight = sum(W) ball_weight = decimal.Decimal(total_weight / M) result = [] eps = decimal.Decimal(0.0001) for w in W: cnt = w / ball_weight + eps result.append(int(cnt)) print(*result)