Work is calculated using the formula:

Where:
W=Work
F = Force
d = distance
Now your problem gives you the following:
W=500 Newton-meters
F=100 Newtons
The trick with problem solving is you put in what you know and solve for the unknown.
So using the formula, you can solve for your missing distance:


To get d, you need to isolate it on one side of the equation. It is beside force, so you need to move the to the other side. Transpose it and use the opposite operation.



The books were moved
5 meters.