Do either of these links help?

The Bin-Packing Problem http://mathworld.wolfram.com/Bin-PackingProblem.html
The Knapsack Problem http://en.wikipedia.org/wiki/Knapsack_problem

No way is known...