An array of integers is given. A segment of the array is a group of consecutive elements with at least one element. Your task is to find the largest possible sum of a segment of the given array.
Input
The first line contains a single integer - the number of testcases.
- The first line of each testcase contains an integer - the number of elements.
- The next line contains integers - the elements of the array.
Output
For every testcase print a single line with the largest sum of a segment.
Example
Input
2 6 2 -3 4 -1 3 -2 3 -5 -2 -8
Output
6 -2
In the first testcase the best segment is with sum . In the second testcase every element is negative, so the best segment is the single element .
Constraints
This problem was adapted, with permission, from Maksimalni zbir segmenta, authored by Društvo matematičara Srbije and Fondacija Petlja.