#P1562. 还是 N 皇后

还是 N 皇后

Description

As the title says, this is the famous NN-Queens problem.

Input Format

The first line contains an integer NN. Then follow NN lines, each with NN characters, describing a board; * means placeable, . means not placeable.

Output Format

Output the total number of solutions.

4
**.*
****
****
****
1

Hint

0<N140 < N \le 14.

Translated by ChatGPT 5