Logical solution to the poisoned cup problem from “The Princess Bride”