Knapsack problem

With and without allowing repetition.