The ratio of Greta's jellybeans to Devin's jellybeans was 5:2. After Greta ate 36 jellybeans, the ratio became 1:2. How many jellybeans did Greta have at first?
G / D = 5/2
G = (5/2)D
(G - 36) / D = 1/2
(5/2 D - 36) / D = 1/2 cross-multiply
2 ( 5/2 D - 36) = D
5D - 72 = D
5D - D = 72
4D = 72
D = 72 / 4 = 18
G = (5/2) D = (5/2)(18) = 45