This is a riff on a classic problem, given in Challenging Problems in Algebra.
“N. Bank and S. Bank are, respectively, the north and south banks of a river with a uniform width of one mile. Town A is 3 miles north of N. Bank, town B is 5 miles south of S. Bank and 15 miles east of A. If crossing at the river banks is only at right angles to the banks, find the length of the shortest path from A to B.
Challenge. If the rate of land travel is uniformly 8 mph, and the rowing rate on the river is 1 2/3 mph (in still water) with a west to east current of 1 1/3 mph, find the shortest time it takes to go from A to B. [The path across the river must still be perpendicular to the banks.]” See the River Crossing.