Distance travelled in first part = 40 km
Distance travelled in second part = 30 x 2 = 60 km
Total distance = 100 km
Total time = 3 h
Average velocity = 100/3 = 33.3 km/h