Create a priority queue with an entry for each bucket, ordered by the penalty score with respect to the bucket to its right
The inputs must be sorted by "value" in increasing order
The last bucket has a penalty of infinity
Entries are doubly-linked to keep track of the relative position of each bucket