I recently came across this [blog post](https://mirror.codeforces.com/blog/entry/92162) and decided to try some of its problems.↵
I am stuck on this [problem](https://mirror.codeforces.com/blog/entry/92162group/JESCgZZ8qn/contest/333999/problem/C).↵
I can think of a naive O(n^2) solution by iterating through all pairs but do not see any redundancy in this solution.↵
I cannot see a way to make it sub-quadratic (other than using the fact that 1 ≤ ai ≤ 2.5 * 10^6, maybe?).↵
Any hints would be appreciated.
I am stuck on this [problem](https://mirror.codeforces.com/
I can think of a naive O(n^2) solution by iterating through all pairs but do not see any redundancy in this solution.↵
I cannot see a way to make it sub-quadratic (other than using the fact that 1 ≤ ai ≤ 2.5 * 10^6, maybe?).↵
Any hints would be appreciated.