and B travel from A and B at the same time unless they meet at point C. After meeting, the two continue to walk forward, go back immediately after reaching their respective destinations, and meet again at point D. At this time, the distance between C and D is 40 kilometers. The ratio of A to D and B to D is 3:1. How many kilometers is the distance between A and B?
甲、乙两人同时从A、B两地除非，在C点处相遇．两人相遇后继续往前走，到达各自的目的地后马上回去，再次在D点处相遇．这时C、D两点相距40千米，A地到D点与B地到D点的比是3：1，求A、B两地相距多少千米？
<gadget id="calculator">7 + 5</gadget>
<output>12</output>

<gadget id="calculator">7 / 12</gadget>
<output>7/12 = around 0.583333</output>

<gadget id="calculator">1 + 3</gadget>
<output>4</output>

<gadget id="calculator">1 / 4</gadget>
<output>1/4 = around 0.25</output>

<gadget id="calculator">(7/12) - (1/4)</gadget>
<output>1/3 = around 0.333333</output>

<gadget id="calculator">40 / (1/3)</gadget>
<output>120</output>

<result>120</result>