ANSWER:
39.21 km
STEP-BY-STEP EXPLANATION:
To determine the answer we track each move just like this:
Coordinates at the start (city A): (0, 0)
Coordinates after going 30 km north: (0, 30)
Coordinates after going 50 km west: (-50, 30)
Southeast is a move down and to the right of 45°, so we calculate at each coordinate, like this:
[tex]\begin{gathered} d_e=20\cdot\cos45\degree=10\sqrt{2} \\ \\ d_s=20\cdot\sin45\operatorname{\degree}=10\sqrt{2} \\ \\ \text{ Therefore:} \\ \\ x=-50+10\sqrt{2}=-35.86 \\ \\ y=30-10\sqrt{2}=15.86 \\ \\ \text{ Coordinates at the start \lparen city B\rparen: \lparen-35.86, 15.86\rparen} \end{gathered}[/tex]We calculate the distance between both points as follows:
[tex]\begin{gathered} d=\sqrt{(x_2-x_1)^2+(y_2-y_1)^2} \\ \\ \text{ we replacing} \\ \\ d=\sqrt{\left(-35.86-0\right)^2+\left(15.86-0\right)^2} \\ \\ d=\sqrt{1285.9396+251.5396}=\sqrt{1537.4792} \\ \\ d=39.21\text{ km} \end{gathered}[/tex]The distance between both cities is 39.21 km