Help I don't understand how to do this homework question, we didn't go over any like it in class.

A car has an average speed of 80.0km/h for 1 hour, then an average speed of 90.0km/h for 2 hours during a 3 hour trip. what was the average speed for the 3 hour trip?

figure the distances at each speed and time.

avgtripspeed=totaldistance/3hrs