Here's my first guess: put the king in one corner, then put queens in every single other square of the board that isn't in the same row, column, or diagonal as the one with the king. There will be (m-1)+(n-1)+(min(m,n)-1)+1 of those squares, so you get mn-m-n-min(m,n)+2 queens total. On an 8x8 board, that'd be 64-8-8-8+2 or 42.
I'm assuming it doesn't matter if the queens can attack one another; you didn't say it mattered.
@JulieSqveakaroo @dodec It seemed like a more interesting problem at first, but yeah, this sounds right.
@Rosemary @JulieSqveakaroo @dodec I think you can place it anywhere along the short edges, actually
each diagonal square you add by moving it away from the corner is going to correspond to a diagonal square removed on the other side