A science store makes two boxes, a cheap and expensive box. The cheap box contains 3 units of metal and 5 units of acid which can be mixed to create 8 units of foam. The expensive box contains 5 units of metal and 8 units of acid which can be mixed to create 10 units of foam. The cheap box however gives off 2 units of heat while the expensive box gives off 3 units of heat. The science store has available 200 units of metal and 300 units of acid. If at most 50 units of heat can be given off, how many of each box should the store make to maximize the amount of foam produced?