Let the total distance be d.
For the first half of the distance, `A` to `B`:
`t_(0)=(d//2)/v_(0)=d/(2v_(0))`
For the next half of the distance, `B` to `C`, let the time be t.
`d_(1)=v_(1)t/2, d_(2)=v_(2)t/2`
`d_(1)+d_(2)=d/2 implies ((v_(1)+v_(2))t)/2=d/2`
`implies t=d/(v_(1)+v_(2))`
Total time of journey `=t_(0)+t=d/(2v_(0))+d/(v_(1)+v_(2))`
Average speed`=d/(d/(2v_(0))+d/(v_(1)+v_(2)))=(2v_(0)(v_(1)+v_(2)))/(2v_(0)+v_(1)+v_(2))`