Added a solving function for conditional ranking problems.