#K73057. Maximum Product Pair Indices

    ID: 33890 Type: Default 1000ms 256MiB

Maximum Product Pair Indices

Maximum Product Pair Indices

Given an array of integers \(A = [A_1, A_2, \dots, A_N]\), your task is to find two indices \(i\) and \(j\) (with \(1 \le i < j \le N\)) such that the product \(A_i \times A_j\) is maximized.

If there are multiple pairs with the same maximum product, choose the pair with the smallest \(i\). If there is still a tie, choose the one with the smallest \(j\).

For example, if \(A = [1, 5, 4, 3, 2]\), the answer is (2, 3) because \(5 \times 4 = 20\) is the maximum product.

Note: The indices in the output should be 1-indexed.

inputFormat

The first line of input contains an integer \(N\) representing the number of elements in the array.

The second line contains \(N\) space-separated integers \(A_1, A_2, \dots, A_N\).

outputFormat

Output two integers representing the 1-indexed positions \(i\) and \(j\) of the numbers that yield the maximum product (\(A_i \times A_j\)).

## sample
5
1 5 4 3 2
2 3