Let's use ' t ' to represent half of the time, in hours.
The distance traveled in the first half of the time is (80 t) km.
The distance traveled in the last half of the time is (40 t) km.
The total distance covered is (80t + 40t) = (120t) km.
You said that the total distance covered was 60 km,
so ...
120 t = 60 km
Divide each side by 120 : t (half of the time) = 0.5 hour
Average speed = (total distance covered) / (time to cover the distance)
= (60 km) / (1 hour)
= 60 km/hr .