The books stored in the two bookshelves are equal. If 200 books are taken out from the first bookshelf, and 40 books are placed in the second bookshelf, then the number of books in the second bookshelf is three times that of the first bookshelf. , How many books are stored in each of the two bookshelves?
两个书架所存书的本书相等，如果从第一个书架里取出200本书，而第二个书架再放入40本书，那么，第二个书架的本数是第一个书架的3倍，求两个书架原来各存书多少本？
<gadget id="calculator">200 + 40</gadget>
<output>240</output>

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

<gadget id="calculator">240 / 2</gadget>
<output>120</output>

<gadget id="calculator">120 + 200</gadget>
<output>320</output>

<result>320</result>