A cube is painted yellow on the top and bottom, green on the front and back, and blue on the left and right faces. It is then cut into 343 identical small cubes.
How many small cubes have all three colours?
Given: n = 7.
Only the corner cubes touch three faces of different colours.
Answer: 8