Given an array of $n$ positive integers and a target $x$, find two elements at different positions whose sum is exactly $x$. Print their $1$-based indices (smaller index first). Among all valid pairs choose the one with the smallest first index, breaking ties by the smallest second index. Print IMPOSSIBLE if no pair works.
Input
First line $n$ and $x$; second line $n$ integers ($1 \le a_i \le 10^9$).
Output
Print the two indices, or IMPOSSIBLE.
Example 1
Input
4 8 2 7 5 1
Output
2 4
Discussion
Threads about this problem. Spoilers are collapsed; wrap hints in
||double bars||.No discussion yet. Start a thread if something here needs explaining.