nSum and knapsack