Naive dynamic programming solution to knapsack implemented without solution reconstruction.