20. Jill has some unit cubes which are all black, grey, or white. She uses 27 of them to build a $3 \times 3 \times 3$ cube. She wants the surface to be exactly one-third black, one-third grey, and one-third white. The smallest possible number of black cubes she can use is $X$ and the largest possible number of black cubes she can use is $Y$. What is the value of $Y-X$ ?
A 1
B 3
C 6
D 7
E 9
Solution
D

The surface area of the cube is $6 \times 3^{2}=54$. This means that the black, the grey and the white area should equal $18 \mathrm{~cm}^{2}$ each.
Each unit cube can contribute 3 if it is a corner cube, 2 if it is an edge cube, and 1 if it is a centre of a face.
There are 8 corner cubes, 12 edge cubes and 6 centres of faces. 1 unit cube is completely hidden from the surface. The smallest number of unit cubes to make area of 18 is $X=6$ corner cubes. The largest number of unit cubes to make area of 18 is $12: 6$ centres of faces and 6 edge cubes. Indeed, we can choose the "hidden" unit cube to have the same colour, so we would have used $Y=13$ black unit cubes. In other words, $Y=13, X=6, Y-X=7$.