Cars A and B leave opposite places at the same time from places A and B respectively. Car A travels 40 kilometers per hour, and Car B travels 45 kilometers per hour. Cars A and B continue to move forward after meeting for the first time and arrive at their respective destinations. After the two places A and B, immediately return on the same road at the same speed, and the two cars travel for a total of 6 hours from the beginning to the second encounter. Find the distance between A and B.
甲、乙两车同时分别从A、B两地相对开出，甲车每小时行40千米，乙车每小时行45千米，甲、乙两车第一次相遇后继续前进，各自到达A、B两地后，立即原路原速返回，两车从开始到第二次相遇共行6小时，求A、B两地的距离．
<gadget id="calculator">40 + 45</gadget>
<output>85</output>

<gadget id="calculator">85 * 6</gadget>
<output>510</output>

<gadget id="calculator">510 / 3</gadget>
<output>170</output>

<result>170</result>