Write a program to compute the number of ways to place n queens on an n × n chessboard so that no queen threatens another queen. That is, no two queens can be located on the same row, column or diagonal.
For instance, there are exactly two ways for n = 4:
Input
Input consists of a natural number n > 0.
Output
Print the number of ways to put n queens on an n × n chessboard so that no queen threatens another queen.
Input
8
Output
92
Input
11
Output
2680