User Tools

Site Tools


prelude_3_to_backtracking_--_queens

This is an old revision of the document!


Prelude 1 to Backtracking -- Queens

For this prelude, you are to use your skeleton file for doing backtracking and the number of solutions to the N-Queens problem.

In this variant of the 8-queens problem, you are to put N queens on an NxN chessboard, such that no two o ft

Input

Input consists of a sequence of non-negative integers, N (0 < N < 10), one per line.

Output

For each input value, N, output the number of valid solutions to the N-Queens problem.

Sample Input

2
4
8

Sample Output

0
2
92
prelude_3_to_backtracking_--_queens.1317670544.txt.gz · Last modified: 2011/10/03 12:35 by jtkorb