Backtracking method to solve 0-1 knapsack problem C source code