For a round trip the uphill = downhill distances and the flat = 16 km
so U = D Total roundtrip distance = U + U + F U = uphill D = downhill
U/100 + U/50 + 16 / 80 = 5 hours
(U + 2U) / 100 = 4.8
results in
U =160 and F = 16 and D = 160 ( roundtrip )
total ONE-WAY distance = ( 160+160+ 16 )/ 2 = 168 km