complementary_pairs (not n log n)