Karl is competing in the preliminary round of a talent show called North-Western European Idol (NWEI), and wants to advance to the next round: World Idol. In the talent show, each contestant gets 10 minutes to impress the judges. After all the contestants have performed, each of the judges will cast two distinct votes. A vote can be either in favour of a contestant (meaning this contestant should advance) or against a contestant (meaning this contestant should not advance). The number of contestants that advance to the next round is not known in advance; if there are only very bad contestants, then it is possible that nobody will advance, or if everybody is amazing, then everybody may advance.
Karl is afraid that the judges will not appreciate his programming talents, and hence wants to use his other talent to advance to the next round: hacking. Having gained access to the jury system, Karl is capable of overriding the regular process of counting votes, and instead selecting exactly which contestants advance to the next round. The only problem is, he has to be careful not to arouse suspicion.
Each judge expects that at least one of his (or her) own two votes corresponds to the outcome of the contest. If the outcome contradicts both votes, the judge becomes alarmed. As an example, assume judge Harry casts a vote in favour of Pete and a vote against Sally. If Sally advances and Pete does not, judge Harry will be alarmed and may discover Karl’s tampering with the system.
Since Karl’s programming talents are limited (otherwise he would not have needed his hacking talents), he needs you to make a program that finds out if there is a set of contestants, which includes himself, that he can select to advance to the next round by hacking the jury system, such that it does not alarm any of the judges.