#C14503. Two Sum Indices
Two Sum Indices
Two Sum Indices
Given an array \(A\) of n integers and an integer target \(T\), your task is to find two distinct indices \(i\) and \(j\) (with \(i < j\)) such that:
\(A[i] + A[j] = T\)
You can assume that there is exactly one solution for each test case.
inputFormat
The input is read from stdin and consists of three lines:
- The first line contains an integer \(n\) representing the number of elements in the array.
- The second line contains \(n\) space-separated integers, representing the array \(A\).
- The third line contains an integer \(T\), the target sum.
outputFormat
Output the two indices (0-indexed) separated by a single space, read from stdin and printed to stdout.
## sample4
2 7 11 15
9
0 1