Solve knapsack problem (no optimizations)