Today's 8th-grade math homework feels like a problematic google coding interview. There's a trick you need to know that makes it easy. Don't know the trick? Good luck with calculus instead.
@airspeedswift my initial thought is you know the total distance north/south, and the total east/west. Then use Pythagorean theorem to get the hypotenuse.