Problem 4057 · Medium
Count the disjoint pairs by sorting the starts, then subtract them from all pairs.
Open the interactive visualisation