Let's ask ourselves a few questions:
Clearly, the second robot will go half the distance of its fuel, plus half the distance of the fuel it gets from the first robot. To maximize the amount of fuel that it gives to the second robot, the first robot should travel a/3 units, give a/3 fuel to the second robot, and then travel back to the start. Think about why:
So, this means that the second robot will travel a maximum of b/2 + a/6 units.
It's a simple matter of algebra to show that it's when a > b. Good -- now we know how to order two robots. In fact, if you think about it, this means that if you have any number of robots, the one with the greatest capacity should go last.
So now we know a very important fact -- given a collection of n robots, we should order them in ascending order of capacity to maximize their distance. Calculating the distance is a really easy O(n) operation.
So now that we know how to calculate the best distance given a collection of robots, we can turn our attention to choosing the robots. It seems quite natural to me to sort the robots in decreasing order of capacity. Then start to think of a systematic way to calculate distances:
MF() will be a recursive procedure with the following cases:
Happy hacking!