For example, we have $n = 5$ boys and $m = 6$ girls, we don't want $k \le min(n, m)$ | $k = 3$ boys or girls to sit next to each other.
A valid arrangement: $BBGGBGGBGG$
An invalid arrangement: $BBBGGBGGBGG$ - There are $3$ boys sit next to each other.
And we ignore the permutation between any group of boys and girls so $BBGGBGGBGG$ is considered only $1$ way