Teacher Wang bought more than 300 pieces of candy, and he wanted to put these candies in small boxes. If every 8 pieces are packed in a box, there are 4 pieces left; if every 10 pieces are packed in a box, there are 4 pieces left. How many candies are there at least?
王老师买了300多块糖，他要把这些糖装在一个个小盒子里．如果每8块装一盒，余4块；如果每10块装一盒，也余4块．这些糖果至少有多少块？
<gadget id="calculator">2 * 2 * 2 * 5</gadget>
<output>40</output>

<gadget id="calculator">40 * 8</gadget>
<output>320</output>

<gadget id="calculator">320 + 4</gadget>
<output>324</output>

<result>324</result>