Cars A and B leave opposite directions at the same time from places A and B respectively. They meet for the first time at a distance of 40 kilometers from place B. After the meeting, the two cars continue to drive and return immediately after reaching the destination. The second time they meet at a distance of 20 kilometers from place A. They meet at a distance of 1,000 km, what is the distance between AB and AB?
甲乙两车分别从A、B两地同时相向开出，第一次在距B地40千米处相遇，相遇后两车继续行驶，各自到达终点后立即返回，第二次在距A地20千米处相遇，求AB两地间的距离是多少．
<gadget id="calculator">40 * 3</gadget>
<output>120</output>

<gadget id="calculator">120 - 20</gadget>
<output>100</output>

<result>100</result>