This is a solution to problem 21 on the hard interview questions node. If you have not read the question, the following will make no sense to you:

Planes 1 and 2 take off eastbound, and travel a quarter of the way around the world. At this point, both their tanks are half empty, so 2 transfers all of its fuel to plane 1 and lands. Now plane 1 has a full tank.

Once plane 1 is halfway around the world, plane 3 takes off westbound and meets plane 1 when plane 1 is three quarters of the way around the world. At this point, plane 1's tank is empty and plane 3's is half empty. Plane 3 then transfers all its fuel to plane 1, who is thus able to finish the last quarter of the journey.