dp: 8-queens problem