On maximizing a sum of ratios