#K89357. Two Sum Problem

    ID: 37512 Type: Default 1000ms 256MiB

Two Sum Problem

Two Sum Problem

You are given a list of integers and a target integer \( T \). Your task is to find the indices of the two numbers in the list whose sum is equal to \( T \). Assume that each input has exactly one solution, and you may not use the same element twice.

Note: The indices of the numbers in the list are zero-based. For example, if the list is [2, 7, 11, 15] and \( T = 9 \), the solution is indices [0, 1] because \( 2 + 7 = 9 \).

Your solution should read input from stdin and write the result to stdout.

inputFormat

The input consists of three lines:

  1. The first line contains an integer \( n \) representing the number of elements in the list.
  2. The second line contains \( n \) space-separated integers, representing the elements of the list.
  3. The third line contains a single integer \( T \), the target sum.

outputFormat

Output a single line with two space-separated integers representing the indices of the two numbers such that their sum equals \( T \). The indices should be printed in ascending order if that is the order found by your solution.

## sample
4
2 7 11 15
9
0 1

</p>