Well, they ran 8 miles north and then 5 miles west.
If you could picture this, they went 8 miles up and the 5 miles to the left. They formed a right angled triangle from their start point.
They shortest distance is the hypotenuse of the triangle, so we use Pythagoras' Theorem:
Let the hypotenuse be x:
x^2 = 8^2 + 5^2
x^2 = 64 + 25
x^2 = 89 Take square root of both sides
x = √89 = 9.434
To the nearest tenth, the shortest distance they must travel = 9.4 miles.