The Meet-in-the-Middle Principle for Cutting and Packing Problems