Comments

Can someone help me with que 4 of Div2. How the author arrived at this solution? And how it was decided if pair was good or not?