The first 300 km covered at a speed of 30 km/hr, so the time taken = 300/30 = 10 hr.
The next 300 km covered at a speed of 50 km/h, so the time taken = 300/50 = 6 hr.
So average speed = Total distance covered/Total time = 600 km/16 hr = 37.5 km/hr.