I find that for this type, always easier to set up a simpler case; you can then "see"

what's involved; have a look at this one:

X[A,B].....................................120.......... ..............................[C]Y

Distance of straight path X to Y is 120.

A, B are at X, and motorcycle C is at Y; speeds are 5,6,10 respectively.

Code:

1: C meets A in 120 / (5 + 10) = 8 hours; B has travelled 8 * 6 = 48
X......40.........[C,A,8h]................80.......................Y
X.........48...........[B,8h]................72....................Y
2: C drives A for 6 hours, to 20 from Y; B goes another 6 * 6 = 36
X......................100........................[C,A,14h]...20...Y
X....................84....................[B,14h].......36........Y
3: C is now 16 from B; turns around and meets B in 1 hour; A travels 5
X.......................105...........................[A,15h]..15..Y
X......................90...................[C,B,15h]......30......Y
4: C drives B for 3 hours; A travels 15; both arrive at Y at same time
X..............................120..........................[A,18h]Y
X..............................120........................[C,B,18h]Y

That's all you get from me!

Should be easier now for you to set this up your own way, and bring in the 3rd walker.