(the problem was UVa's #278 - Chess and we had a chess buff in the group
@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
@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
@BatElite you're right i mixed them up
@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.