Given an array A having N distinct integers.
The power of the array is defined as:
Let's say the array is {1,2,5}, then the power of the array is , which simplifies to which is equal to 3.
Operation Allowed:
If you are allowed to choose any two indices x and y and swap and , find out the maximum power that can be achieved.
Note: You are allowed to perform the above operation at most once.
Input:
First line consists of a single integer, T, denoting the number of test cases.
First line of each test case consists of a single integer, denoting N.
Second line of each test case consists of N space separated integers denoting the array A.
Output:
For each test case, print the maximum achievable power on a new line.
Constraints:
In the first test case, we don't need to do any swaps, the max achievable power is 1.
In second test case we can swap and so the array will be 2 3 1 4 and the power will be 3.