You are given an array of size . You can fix any element, say of the array and all the elements in the array greater than or equal to become and all the elements less than multiplied by -1. You have to find the maximum sum of the array after fixing .
Input Format
The first line contains T, the number of test cases.
For each Test case :
The first line contains an integer N, size of the array.
The second line contains N space-separated integers, the of which is .
Input Constraints
Sum of N all over testcases doesn't not exceed .
Output Format
For each test case, print the maximum sum of the array by fixing an element .
Answer for each test case should come in a new line.
Note
Candidates are expected to write complete code of searching, sorting etc. (if they are being used in the code) instead of using builtin functions provided by the language library.
Using builtin functions may lead to disqualification from the shortlisting process.
If we fix K=1, answer = 1+1+1 = 3
If we fix K=2, answer = 2+2-1 = 3
If we fix K=3, answer = 3-1-2= 0
Maximum among them is 3.