Solving ratio problems with given quantity