@squirrel That looks impossible to me if you don't have a chess buff.
But then that seems to be my problem every time something asks for this or permutations of stuff and other statistics stuff I was never thought. I'm not a mathematician capable of deriving algorithms for those things.
@BatElite it's really really simple, you don't have to check anything, there are simple equations to how many pieces of each kind you can fit in an n x m board
f.ex for rooks, they attack only directly horizontally to them, so every other spot can have a rook
so (n*m/2) rounded up
@BatElite you're right i mixed them up