ex5 of PE knapsack.  finally.