Answer:
The question is incomplete.
It asks you to use the formula W = F * D (force times distance)
But the question only gives the work W in joules.
You would need to know the weight of the object to get the distance moved or the distance moved to get weight if you are only given the work done.
Incidentally, the mechanical advantage in diagram is A is 1 whereas the mechanical advantage in B is 2.
So in B you would apply 1/2 the force as in A and would have to move the rope twice as far as in A to do the same amount of work.