Given $n$ persons, this question is about a sequence of unordered pair of persons, called a two-person schedule(TPS). A TPS is good if any of its initial contiguous subsequences satisfies the following two conditions.
(fairness requirement) Any person cannot appear two times more than any other person.
(non-repeating requirement) Any unordered pair of persons can appear at most once.
This question asks the best way to generate a good TPS that is as long as possible.
Let us define a perfect TPS as a TPS that satisfies the following requirement.
(inclusive requirement) Each unordered pair of persons is included.
It turns out that a good TPS of the longest length must be a perfect TPS.
Run code button. You will see output like the following.