A train moves with a speed of 30 km | hr for 12 minutes and for next 8 minutes at a speed of 45 km/hr. The average speed of the train is:

A train moves with a speed of 30 km | hr for 12 minutes and for next 8 minutes at a speed of 45 km/hr. The average speed of the train is:

Explanation
36km/hr
Distance= Speed × Time
Distance covered by the train with the
speed of 30 kmph in 12 minutes is 
= 30   × 12/60 = 6km
Distance covered by the same train with the speed of 45kmph in 8 minutes is
=45  × 8/60 = 6km 
Average speed
    = total distance/ total time. 
(6 + 6) km / (12 + 8) min = 12/20  × 60
= 36kmph