4. Given a $5 \times 100$ grid where $n$ cells are colored black and the rest are colored white. If two cells share a common edge, they are called "adjacent cells". Each cell has at most two black adjacent cells. Find the maximum possible value of $n$.


4. In a $5 \times 100$ grid, the outermost layer and the third row (excluding intersections with the 2nd and 99th columns) are colored black, satisfying the conditions. This results in a total of 302 black cells.

Using 1 left piece, 24 middle pieces, and 1 right piece from Figure 2 to color the $5 \times 100$ grid.

In each piece, at most two cells with the same letter can be colored black, so the maximum number of black cells is
$$
(5+24 \times 6+1) \times 2+2=302 \text {. }
$$