1-indexed sorted array. Two pointers from ends — no hash needed.
Input
4 9 2 7 11 15
Output
1 2
3 6 2 3 4
1 3