There are guests. Guest wants to drink cups of tea and cups of coffee.
Each guest has a fixed preference :
In one round, you choose one drink and any subset of the guests. Each selected guest receives and drinks exactly one cup of that drink. The other guests drink nothing in that round.
Find the minimum number of rounds needed to serve every guest exactly the requested number of cups, respecting their preferences.
Use the drink sequence T, C, T. The first guest drinks in rounds and , and the second guest drinks in rounds and . Two rounds cannot satisfy both opposite preferences.
Use the drink sequence T, T, C, C, C. The first guest drinks in rounds , and the second guest drinks in rounds . At least two tea rounds and three coffee rounds are necessary, so the answer is five.
Use the drink sequence T, C, C, T, T, C. The first guest drinks in rounds , the second in rounds , and the third in rounds . At least three tea rounds and three coffee rounds are necessary, so six is optimal.
Use the drink sequence C, T, T, T, T, C, C, C. The first guest drinks in rounds , and the second in rounds . Seven rounds would have to consist of exactly four tea rounds and three coffee rounds. The second guest would need a coffee before all four tea rounds, while the first would still need three coffees after drinking tea. This is impossible with only three coffee rounds, so eight is optimal.