How is it possible to solve this question without brute forcing
This is just the Monty Python problem and is not designed to be solved with raw combinatorics.