You have not responded to Corion's comment about "good" binning. Is any valid solution "good enough"? Do you have additional criteria, but do not know how to specify them? Consider how you would want to divide the list of integers (0..1001). (Note that there are over 1000 possible solutions using two bins. Far more if more bins are allowed.)