You are given an integer array of size . You need to select an integer and perform the following operation exactly once.
Your goal is to make the array non-decreasing.
Output the minimum and number of possible that makes the array non-decreasing.
If it is impossible to find such , output .
The first line of the input contains a single integer — the number of test cases.
The first line of each test case contains an integer — the number of elements in the array.
The second line of each test case contains space-separated integers — the elements of the array.
It is guaranteed that the sum of over all test cases does not exceed .
For each test case, if it is impossible to find such , then output . Otherwise, print two integers — minimum and the number of possible .
Input | Output |
---|---|
6 2 2 1 2 1 2 1 0 6 6 5 4 3 2 1 4 86 107 101 112 8 113 116 97 101 92 103 107 110 | 2 1073741824 0 1073741824 0 2147483648 7 268435456 8 268435456 -1 |
Test case : Minimum . Assign, So, . The array is now sorted. Total possible solutions . |