Two cities A and B are driving in opposite directions at the same time. The two cars meet for the first time at a distance of 50 kilometers from city A. After arriving at the station, they return separately and meet again at a distance of 40 kilometers from city B. What is the distance in kilometers between cities A and B?
A、B两城同时对开客车，两车第一次在距离A城50千米处相遇，到站后各自返回，在距离B城40千米处又相遇．求A、B两城相距多少千米？
<gadget id="calculator">50 * 3</gadget>
<output>150</output>

<gadget id="calculator">150 - 40</gadget>
<output>110</output>

<result>110</result>