public class Empress {
/**
* @param args
*/
private int n;
private int[] x;
private static char[][]y;
private long sum;
private static int z;
public Empress(int n) {
this.sum = 0;
this.n = n;
this.x = new int[n + 1];
this.y = new char[n][n];
z = 1;
}
public boolean place(int k) {
for (int j = 1; j < k; j++) {
if ((Math.abs(k - j)) == (Math.abs(x[j] - x[k])) || (x[j] == x[k])) {
return false;
}
}
return true;
}
public void backTrace(int t) {
if (t > n) {
sum++;
for(int i=0;i