start from first line, first line has 8 situation

if it can find correct position, then recursion

remember the constrain:

c[r] == c[j] || r-j == c[r]-c[j] || r-j == c[j]-c[r]