#C8177. Two Sum Indices
Two Sum Indices
Two Sum Indices
Given an array of integers and a target integer \(T\), find the indices of the two distinct elements such that their sum is equal to \(T\), i.e. if the array is \(A = [a_0, a_1, \ldots, a_{n-1}]\), find indices \(i\) and \(j\) (with \(i < j\)) such that \(a_i + a_j = T\). It is guaranteed that exactly one solution exists. The solution indices should be printed in increasing order.
Note: The indices are zero-based.
inputFormat
The input is given from standard input (stdin) and consists of three lines:
- The first line contains an integer \(n\), the number of elements in the array.
- The second line contains \(n\) space-separated integers, representing the array \(A\).
- The third line contains the target integer \(T\).
outputFormat
Print two space-separated integers representing the indices of the two numbers that add up to the target \(T\). The indices should be printed in increasing order.
## sample4
2 7 11 15
9
0 1
</p>