Stupid bug in knapsack.cpp corrected

The g factor should not be multiplied to the final result.