2 answers
(click or scroll down)
a r + a r^2 = 12 ... a r (1 + r) = 12
a r^3 + a r^4 = 300 ... a r^3 (1 + r) = 300
dividing equations ... r^2 = 25 ... r = 5
substitute back to find a