4. Person A has a rectangular piece of paper measuring 40 cm $\times$ 30 cm. He cuts out 10 smaller pieces of paper, each 5 cm $\times$ 5 cm, from it, resulting in the figure on the right. The edges of these 10 smaller pieces are parallel to the corresponding edges of the rectangle, and they do not overlap with each other. Therefore, the perimeter of the remaining shape is ( ) cm.
【Analysis】Each time a small square is cut out, the perimeter increases by $2 \times 5=10$, so $C=(40+30) \times 2+2 \times 5 \times 10=240$