Can we have better solution than O(n^2 log n) for the following problem 1.
Problem 1 from Past Online assesment of Citadel
Interview with orz | IMO Gold Medalist, ICPC World Finalist, IGM in CF