## Exercise ‹2›:

N queens
Solve the following exercise by means of a reduction to SAT:
• Find a way to place $n$ queens in an $n\times n$ chessboard so that no two queens threaten each other. In other words, no two queens share the same row, column or diagonal.
The input of the exercise and the output with the solution (when the input is solvable) are as follows:
• n: int

The input is $n$, the size of the board, as well as the number of queens to place in it.
• chessboard: array of array of int

The output consists of a two-dimensional array simulating the board. It should have size $n\times n$. The position $(i,j)$ should contain a $1$ if a queen is placed there, or a $0$ otherwise. The rows and columns are identified by a number between $0$ and $n-1$.
Authors: Nil Mamano / Documentation:
 reduction { // Write here your reduction to SAT... } reconstruction { // Write here your solution reconstruction... } To be able to submit you need to either log in, register or become a guest.