A sinatra application solution of a variant of the knapsack problem