Simple variation of the classic knapsack problem in C#