@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
@squirrel It's getting to those equations though :P If you're allowed to find those somewhere the programming would seem trivial.
Also I'm guessing you're thinking about kings? That sounds about right. For rooks I'm thinking since they "take up" their entire row and column, the best you can do is {whichever of m and n is smaller} arranged diagonally.
That leaves queens and knights then, and those are probably the more difficult ones to figure out. Queens *might* be the same as rooks?
Also ty