Problem 2. A group of adventurers is showing off their loot. It is known that exactly 9 adventurers have rubies; exactly 8 have emeralds; exactly 2 have sapphires; exactly 11 have diamonds. Moreover, it is known that

- if an adventurer has diamonds, then they have either rubies or sapphires (but not both at the same time);
- if an adventurer has rubies, then they have either emeralds or diamonds (but not both at the same time).

What is the smallest number of adventurers that can be in such a group?
Answer: 17.

Solution. Note that the number of adventurers who have diamonds is equal to the total number of adventurers who have rubies or sapphires. Then, from the first condition, it follows that 9 adventurers have rubies and diamonds, and 2 have sapphires and diamonds. That is, every adventurer who has rubies must also have diamonds. Then, from the second condition, there cannot be an adventurer who has both rubies and emeralds. Therefore, there must be at least $9+8=17$ adventurers.

Indeed, there can be this many adventurers: let's say we have 9 adventurers who have rubies and diamonds, 2 adventurers who have emeralds, sapphires, and diamonds, and 6 adventurers who have only emeralds. One can verify that this example meets all the conditions.