A has 36 extra-curricular books, and B has 24 extra-curricular books. After both donate the same number of books, the number of books left by A is three times the number of books left by B. How many books do they each donate?
甲有36本课外书，乙有24本课外书，两人捐出同样多本书后，甲剩下的书本数是乙剩下书本数的3倍，两人各捐多少本书？
<gadget id="calculator">36 - 24</gadget>
<output>12</output>

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

<gadget id="calculator">12 / 2</gadget>
<output>6</output>

<gadget id="calculator">24 - 6</gadget>
<output>18</output>

<result>18</result>