Official algorithmic problem description and constraints.
You are given an array A of size N.
Find a pair of indices (i,j) such that:
In case multiple (i,j) pairs are valid, you can print any one. If it is impossible to find such (i,j), output −1 instead.
Detailed video explanations, mathematical intuition, and clean C++ implementation code.