This is my homework. And I don't want to ask for solution of any kind. I just want some clue, hint, strategy to start.
P/s : I have solved the n queens problem using stack before, but I have got stuck with this one for 3 days.Find a placement of k queens on an n x m chessboard such that the queens will dominate each of the n x m cells. And I have to solve this problem using stack.