The angle between the two ships is 90 degrees. Now it is equivalent to knowing a right-angled edge, and the sailing distance of A is 16*2=32. Know a hypotenuse The distance between two ships, 40. The ship distance of B is another right angle √ (40 2-32 2) = 24. Over.