Knapsack optimization: divide individual weights and the total knapsack
capacity by the greatest common divisor of original weights