Problems
#862
~/algor $ cat problems/SO0A4aXHkHcQ
The painted cube
Hidden (link only)
Medium
1000 ms
64 MB
46%
All 6 faces of a wooden cube with edge were painted. Then the cube was sawn into small cubes with edge . Find how many small cubes have exactly 3, exactly 2, exactly 1 and no painted faces.
Input
One positive integer .
Output
One line with four integers: the number of small cubes with exactly 3, 2, 1 and 0 painted faces.
Note
Examples
Input #1
3
Output #1
8 12 6 1
Input #2
5
Output #2
8 36 54 27