Mock CCC '26 S1 - A Cube Problem
View as PDFMock Canadian Computing Competition: 2026 Senior #1
Jeremy loves his cubes. He has an unlimited supply of unit cubes, and as a hobby, he creates larger cubes by connecting the unit cubes. Specifically, he's created a cube with side length , that is to say, each edge has the same length as
small cubes. Now, this newly created cube looks extremely boring. Jeremy decides to paint the exterior of the cube. Seeing his new creation, Jeremy is happy with the cube, so he removes the cubes with paint on them to create a smaller, unpainted cube. He then repeats this process until every block in the cube has paint on at least one of its sides.
After putting his painted cubes in a bin, Jeremy runs into an issue: he doesn't know how many cubes have ,
,
,
,
and
painted faces. As his good friend, you have graciously offered to help Jeremy count the cubes for him!
Below is a diagram representing the outer faces painted on a cube where . In this diagram, the blue, white and red represent the cubes with 1, 2, and 3 painted faces, respectively. Note that in this step, there are no faces with 4, 5 or 6 faces painted.

Once this step is complete, we have only cube remaining, which we paint all
sides of.

Input Specification
The first and only line of input contains an integer .
The following table shows the point distribution for this problem.
| Marks | Bounds on |
Additional Constraints |
|---|---|---|
| None | ||
Output Specification
In one line, output the number of cubes with ,
,
,
,
and
faces painted, respectively.
Sample Input
3
Output for Sample Input
6 12 8 0 0 1
Explanation of Output for Sample Input
If we look at our diagram, there are total cubes with
face painted (the center of each face),
with
faces painted (
on each edge),
with
faces painted (The
corners), and
with
faces painted (the core).
Comments