Gary, Mary, and Rory have the same number of candies. If Gary gives Mary half of all his candies, then Mary gives Rory half of all the candies she has at the moment, and then Rory gives Gary half of all the candies he (Rory) has at the moment, Gary would have 12 more candies than he had originally. How many candies do Gary, Mary, and Rory have altogether?
Let Gary, Mary and Rory start out with N candles each
Gary gives Mary 1/2 of his candles
Mary has ( N + N /2) = (3/2)N candles
Gary has N/2 candles
Mary gives Rory half of her candles
Mary has (3/4)N candles
Rory has (N + (3/4)N) = (7/4)N candles
Rory gives Gary half of his candles
Rory has (7/8) candles
Gary has (N /2 + (7/8)N) = (11/8)N candles
And now, from Gary's point of view, he started with
(11/8)N = N + 12
(11/8)N - N =12
(3/8)N = 12
N = 12 ( 8/3) = 96 / 3 = 32 candles
They have 3(32) = 96 total candles