There are 47 children. The teacher should give each of them one red pen and one blue pen. In the store, each pen is 5 pens in a bag or 3 pens in a bag. It is not allowed to open the bag for retail. The red pen of 5 pens in a bag is 61 yuan, the blue pen is 70 yuan, the red pen of 3 pens in a bag is 40 yuan, and the blue pen is 47 yuan. The teacher needs at least 50 yuan to buy the pens

There are 47 children. The teacher should give each of them one red pen and one blue pen. In the store, each pen is 5 pens in a bag or 3 pens in a bag. It is not allowed to open the bag for retail. The red pen of 5 pens in a bag is 61 yuan, the blue pen is 70 yuan, the red pen of 3 pens in a bag is 40 yuan, and the blue pen is 47 yuan. The teacher needs at least 50 yuan to buy the pens

If you also want to buy 15 pens, buy 5 red pens in a bag for 183 yuan and blue pens for 210 yuan; buy 3 red pens in a bag for 200 yuan and blue pens for 235 yuan
Thus, it can be seen that it's cost-effective to buy 5 pens in a package. If there are less than 5 pens left, use 3 pens to top them
Therefore, the best plan is to buy 9 bags of 5 pieces + 1 bag of 3 pieces
So the cost = 9 × (61 + 70) + 1 × (40 + 47) = 1266
Identification completed