Productive Meeting
MediumRating 1400CodeforcesHeap / Priority Queue
Approach hintTry it first, then revealHide
Repeatedly let the two people with the most remaining talks speak to each other, using a max-heap of (remaining, index) pairs; push them back while their counts stay positive and record each pair.