A car travels from City A to City B at an average speed of 60 km/h. After reaching City B, it takes a rest for 1 hour and then returns to City A at an average speed of 40 km/h. If the total time spent on the journey (including the rest time) is 7 hours, what is the distance between City A and City B? Let's think step by step and output the final answer within \boxed{}.
user