The time of travel of A can be found easily by
TA = L / (V1 + V2) + L / (V1 - V2) = 2 n L V2 / (n2 -1) ----------(1)
For the time of travel of B we should know that the direction of velocity of B should be at angle q (with respect to the perpendicular to the flow of water) so that it will going perpendicular to A and is given by
Sin q = V2 / V1 --------------------- (2)
And the resultant velocity is given by
V1 cos q ----------------------------(3)
Therefore
TB = 2 L / Ö(V12 - V22) = 2 L V2 / Ö (n2 - 1) ---------------(4)
Therefore
TA / TB = n / Ö (n2 - 1)
Given n value we can find the ratio.