solution about n-queens