Problem 5. (6 points) Peter has $n^{3}$ unit white cubes, from which he wants to assemble a cube $n \times n \times n$ with a completely white surface. How many of the faces of the unit cubes does Emil need to color to prevent Peter? Solve the problem for:
a) (3 points) $n=3$;
b) (3 points) $n=1000$.
Solution. a) It is sufficient for Emil to color the walls of two cubes, as when assembling a $3 \times 3 \times 3$ cube, only one small cube can be completely hidden.

We will show that if no more than 11 walls are colored, Peter can assemble a $3 \times 3 \times 3$ cube with uncolored outer walls. Emil colors at least two walls of a small cube, because one colored wall can be hidden in any position of the small cube. Therefore, at most 5 small cubes have colored walls. Peter will place the small cube with the most colored walls in the center of the large cube, and the remaining small cubes with colored walls in the centers of the faces of the large cube, with their outer walls being uncolored. (Each of them has at least one uncolored wall, as only one small cube can be completely colored, and if there is such a cube, it is in the center of the cube.)

Therefore, Emil must color at least 12 walls.

b) It is sufficient for Emil to color two opposite walls of $1000^{3}-7$ small cubes, i.e., a total of 199999986 walls. Then one of the eight corner small cubes of the large cube will have two opposite colored walls, and one of them will definitely be an outer wall.

If fewer than $2 \cdot 1000^{3}-14$ walls are colored, the small cubes with no more than one colored wall are at least 8. Peter places them in the corners of the large cube (hiding, if necessary, one colored wall of a small cube). The small cubes with no fewer than 3 colored walls are no more than $\frac{2 \cdot 1000^{3}}{3} < 998^{3}$. Therefore, Peter can hide them inside the large cube. The remaining small cubes must be placed along the edges and inside the faces of the large cube. Peter places each of them so that the colored walls (at most two) are not outer walls.

Therefore, Emil must color at least $2 \cdot 1000^{3}-14$ walls.