Problem 587 -- There's treasure everywhere!

read problem

Tips

Pythagoras theorem