A certain car averages 25 miles per gallon of gasoline when driven in the city and 40 miles per gallon when driven on the highway. According to these rates, which of the following is closest to the number of miles per gallon that the car averages when it is driven 10 miles in the city and then 50 miles on the highway?