Then X/3+(23.5-X)/5=6.5.
The solution is X= 13.5.
He went up the mountain from B's original road, crossed the top of the mountain and returned to A.
Time = (23.5-13.5)/3+13.5/5 =181/30 (hours)