It's really not a trick. You simply take all the knowledge you are given and (this is important) don't make any additional assumptions or guesses or even really think of the participants as human, and.solve it like a math problem.
Yeah. I'm completely unable to do any of the stereotypical interview question puzzles which hinge on an "outside the box" trick, but I had no trouble recognizing this as a straightforward problem that you just work through.