4 ms·
Solution in SageMath: from sage.numerical.knapsack import knapsack knapsack([122, 275, 185, 597, 647, 216, 713, 457, 146, 518, 316, 489, 711, 645, 477, 804, 67
by octonion 5y ago
Solution in SageMath:
from sage.numerical.knapsack import knapsack
knapsack([122, 275, 185, 597, 647, 216, 713, 457, 146, 518, 316, 489, 711, 645, 477, 804, 671, 231, 621, 98, 87], max=4394)
Note that this only finds a solution, not all solutions.