To see if this checks out, consider the time for going the shortest distance (previous problem, going straight across): 21.8 seconds.
If we head straight across (? = 0o), then
vx = vboat cos(?) = 5 m/s cos (0o) = 5 m/s.
t = w/vx = 100 m / (5 m/s) = 20.0 seconds.
In heading straight across we will go a further distance (due to our y motion - downstream) but we will go faster, and the faster “wins”. In going straight across, we used some of our boat velocity to “fight” the river.