Pick the largest k times

piles is a list of positive whole numbers. You make k picks; each pick takes the largest pile's current value as your score and then halves that pile, rounding up. Write max_score(piles, k) that returns the total score.

max_score([10, 10, 10, 10, 10], 5)  ->  50
max_score([1, 10, 3, 3, 3], 3)      ->  18     (10, then 5, then 3)

The point is to practise a heap where popped items go back changed.

def max_score(piles, k):
    ...