P27845 [洛谷] [Language Monthly Contest 202306] Rubik's Cube
普及-
题目描述

Problem Description

A regular-order Rubik's Cube is shaped like a cube, with each face composed of several smaller equal-sized squares. For an \( n \) (where \( n \geq 2 \)) order Rubik's Cube, each of its six faces is composed of \( n \times n \) smaller squares.

The six faces of the Rubik's Cube are dyed with 6 different colors. The smaller squares that are dyed form smaller cubes, which are referred to as "blocks".

It is easy to see that each block has 1 to 3 faces dyed. Therefore, there are three important concepts about blocks in the Rubik's Cube:

  • Corner block: A block with 3 faces dyed. The number of corner blocks in an \( n \)-order Rubik's Cube is always 8.
  • Edge block: A block with only 2 faces dyed. The number of edge blocks in an \( n \)-order Rubik's Cube is \( 12 \times (n - 2) \).
  • Center block: A block with only 1 face dyed. The number of center blocks in an \( n \)-order Rubik's Cube is \( 6 \times (n - 2)^2 \).

Given the order \( n \) of a regular-order Rubik's Cube, please calculate the number of its corner blocks, edge blocks, and center blocks in that order.

Input Format

The input consists of a single line containing an integer \( n \), representing the order of the Rubik's Cube.

Output Format

The output consists of a single line containing three integers, representing the number of corner blocks, edge blocks, and center blocks of the \( n \)-order Rubik's Cube, separated by a space.

Sample Input and Output

Sample Input #1

3

Sample Output #1

8 12 6

Sample Input #2

4

Sample Output #2

8 24 24

Notes

Sample Explanation #1:

For a 3-order Rubik's Cube, the number of corner blocks is always 8, the number of edge blocks is \( 12 \times (3 - 2) = 12 \), and the number of center blocks is \( 6 \times (3 - 2)^2 = 6 \).

Data Range and Constraints

  • For 40% of the test cases, \( 2 \leq n \leq 17 \).
  • For 100% of the test cases, \( 2 \leq n \leq 10^6 \).
输入格式

见题面 Input 部分

输出格式

见题面 Output 部分

样例输入
3
样例输出
8 12 6