Alternative optimization strategy

Pass 1:

Arrange the books into as few maximal sets as possible

Pass 2:

Optimize the discount.  Given the sets are maximal, the overall cost only
decreases when you move a book from a set of size 5 to a set of size 3.