casks casks, and exactly one of them contains spoiled wine. Volunteer tasters help find it.
Testing happens in rounds. At the start of a round, each taster may sip from any set of casks (several people may sip from the same cask), and this takes no time. After react_minutes minutes everyone who tasted the spoiled wine feels sick and drops out; the others carry on. A new round can only start after that. You have total_minutes minutes in total.
Return the smallest number of tasters that guarantees you can identify the spoiled cask in the time available.casks=8, react_minutes=10, total_minutes=10 → 3
There is time for a single round, and each taster gives a yes/no answer. Three tasters cover 2³ = 8 casks: each cask gets its own drank/didn't-drink pattern.
casks=9, react_minutes=15, total_minutes=30 → 2
There are two rounds, so each taster has three outcomes: sick after round one, after round two, or never. Two tasters cover 3² = 9 casks.
casks=1, react_minutes=5, total_minutes=20 → 0
casks=8, react_minutes=10, total_minutes=10
3
Run checks the first 3 tests in your browser. Submit checks all 93 tests on the server, hidden ones included.