Define
d = distance (km) traveled in either direction
t₁ = time (hours) to travel uphill
t₂ = time(hours) to tavel downhill
The time to travel uphill is

Similarly, the time to travel downhill is

The total travel time is

The total distance traveled = 2d km
The average speed is

Answer: The average speed is 48 km/h