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