Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …
Problems
#862

~/algor $ cat problems/SO0A4aXHkHcQ

The painted cube

Hidden (link only)
Medium 1000 ms 64 MB 46%
Share

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.

A painted cube with edge n divided into unit cubes; corner, edge and inner face cubes are coloured differently

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

Sign in to submit a solution

Signing up is free and takes a minute.