#P2225. [HNOI2001] 棋盘变换
[HNOI2001] 棋盘变换
Description
On an board, fill each cell with or . After one transformation, every number in the grid becomes the product of the four numbers that are adjacent to it (up, down, left, and right) before the transformation. For example:

However, some states remain the same before and after the transformation, such as the state where all entries are . Such a state is called an invariant state.
Your task is to find all essentially different invariant states (states that become identical after rotations or reflections are considered essentially the same).
Input Format
One line containing a single positive integer .
Output Format
One line containing a single positive integer, the number of essentially different invariant states.
4
5
Hint
.
Within the given range, the total number of invariant states is .
Translated by ChatGPT 5
京公网安备 11011102002149号