#C9981. Two Sum

    ID: 54134 Type: Default 1000ms 256MiB

Two Sum

Two Sum

Given an array of integers \(\textbf{nums}\) and an integer \(target\), find two distinct indices \(i\) and \(j\) such that \(nums[i-1] + nums[j-1] = target\). The indices are 1-indexed and must be output in ascending order. If there are multiple answers, output the one found first by the algorithm.

Note: The solution should work for multiple test cases.

inputFormat

The input starts with an integer \(T\) on a single line, representing the number of test cases. For each test case, the first line contains two space-separated integers: \(n\) (the number of elements in the array) and \(target\) (the target sum). The second line contains \(n\) space-separated integers representing the elements of \(nums\).

outputFormat

For each test case, output a line with two space-separated integers representing the 1-indexed positions of the two numbers that add up to \(target\). The indices should be in ascending order.

## sample
3
4 9
2 7 11 15
6 6
3 5 -2 8 11 -4
5 -3
1 -1 2 -2 3
1 2

3 4 2 4

</p>