Hi, I am struggling to construct a code that solves a convex problem.

The problem is a maximization problem with an objective function which is continuous, smooth, and concave, but piecewised.

The problem is as follows:

In the above problem, B is a given constant, and C_i for all i are also given constants.

g_{i,1}(x), g_{i,2}(x), g_{i,3}(x) are all concavely increasing function with respect to x.

Also at x=C_i, g_{i,2} and g_{i,3} have the same values and the same derivatives, i.e., g_{i,2}(C_i)=g_{i,3}(C_i) and g_{i,2}β(C_i)=g_{i,3}β(C_i).

How can I solve this convex problem using CVX?