A stochastic knapsack problem with nonlinear capacity constraint