Лимит времени 10000/10000/10000/10000 мс. Лимит памяти 65000/65000/65000/65000 Кб.
Problem description
The goal of the n-queens problem is to position n queens on an nxn chessboard so that no two queens threaten each other. That is, no two queens may be in the same row, column, or diagonal.
Make a program to calculate number of the solution of n-queens problem.
Input
A single integer N (1 <= N <= 14) that is the size of the board.
Output
A single integer denotes the number of different solutions.
Example
Для отправки решений необходимо выполнить вход.
|