whenever you see the word "per" you can ALWAYS substitue in the word "divide". When you see "miles per gallon", change "per" into "divided by" to get miles divided by gallons. That is how you will solve the problem.
SO.....
300 miles รท 10 gallons = 30 miles per gallon