Creates a knapsack item with the given weight (cost) and value (profit).
weight
value
const KnapsackUtils(int weight, int value) : _weight = weight, _value = value;