The number of apples in both baskets A and B is the same. If 20 apples are taken from basket A and 40 are put into basket B, then the number of apples in basket B is three times that of basket A. How many apples are there in the baskets A and B?
甲、乙两个筐里的苹果个数一样多，如果从甲筐里拿走20个，向乙筐放入40个，这时乙筐里的个数是甲筐的3倍．甲、乙两筐原来有多少个苹果？
<gadget id="calculator">20 + 40</gadget>
<output>60</output>

<gadget id="calculator">3 - 1</gadget>
<output>2</output>

<gadget id="calculator">60 / 2</gadget>
<output>30</output>

<gadget id="calculator">30 + 20</gadget>
<output>50</output>

<result>50</result>