Two cars, A and B, depart from city A to city B at the same time. Car A travels 45 kilometers per hour, and car B travels 40 kilometers per hour. After driving for 30 minutes, car A returns to city A at the same speed due to an accident. The city was delayed for half an hour, and then went to city B at the original speed, but the result was 30 minutes later than car B. Find the distance between the two cities.
甲、乙两车同时从A城出发去B城，甲车每小时行驶45千米，乙车每小时行驶40千米，甲车行驶30分钟后，因事以原速返回A城，在A城耽搁了半小时，又以原速去B城，结果比乙车晚到30分钟．求两城间的距离．
<gadget id="calculator">45 * 0.5 * 2</gadget>
<output>45</output>

<gadget id="calculator">40 * 0.5</gadget>
<output>20</output>

<gadget id="calculator">45 - 20</gadget>
<output>25</output>

<gadget id="calculator">45 - 40</gadget>
<output>5</output>

<gadget id="calculator">25 / 5</gadget>
<output>5</output>

<gadget id="calculator">5 - 0.5</gadget>
<output>4.5</output>

<gadget id="calculator">40 * 4.5</gadget>
<output>180</output>

<result>180</result>