The approximants to regular continued fractions constitute best approximations to the numbers they converge to in two ways known as the first and the second kind. This property of continued fractions provides a solution to Gosper's problem of the batting average: if the batting average of a baseball player is 0.334, what is the minimum number of times he has been at bat? In this paper, we tackle somehow the inverse question: given a rational number P/Q, what is the set of all numbers for which P/Q is a best approximation of one or the other kind? We prove that in both cases these optimality sets are intervals and we give a precise description of their endpoints.