I\'m trying to create an algorithm to solve the following optimization problem with each x_i and B as integers and all f_i\'s are monotonic. This looks like a knapsack or co