Problem 3649 · Medium

Number of Perfect Pairs

Count index pairs i < j whose values a and b satisfy two conditions: the smaller of |a - b| and |a + b| is at most the smaller of |a| and |b|, and the larger of |a - b| and |a + b| is at least the larger of |a| and |b|.

Open the interactive visualisation