You are given an integer array
Input Specification
The first line contains an integer
The second line contains
The following table shows how the available
Marks Awarded | ||
---|---|---|
Output Specification
Output the index of the optimal split point and the index of the element that you moved between two subarrays separated by space. If you did not move any element between two subarrays, output -1
for the second number. If multiple solutions exist, output the lexicographically smallest one. The index of the optimal split point takes precedence, and -1
is given higher priority than the index of the moved element.
Sample Input
7
1 2 1 3 3 2 1
Sample Output
3 4
Explanation for Sample
By splitting at index 3 4
is the most optimal split and move point. It can be shown that this is the lexicographically smallest solution.
Comments