Loretta travels by car from one city to another with different constant speeds between pairs of cities. She drives for 30 min at 80 km/h, 12min at 100 km/h, and 45 min at 40 km/hr, and spends 15 min eating lunch and buying gas. Find the distance between two cities as well as her average speed.