Let one side distance = x km.
Time taken for forward trip at a speed of 20 km/h = Distance / Speed = x/20 h.
Time taken in return trip at a speed of 30 km/h = x/30 h.
Total time for the whole trip = {{x \over20} + {x \over30} = {{3x + 2x} \over60} = {5x \over60}}h.
Total distance covered = 2x km.
We know, Average speed = Total distance ÷ Total time
= 2x ÷ (5x/60) = 24 kmh-1 .