The brachistochrone problem with constraints on the curvature of the trajectory