An Algorithm for a Nonlinear Discontinuous Knapsack Problem