Problem: Recall that the sequence is a a subsequence of the sequence if can be derived from by removing zero or more elements without changing the order of the remaining elements. For example, if , then possible subsequences are: , and , but not and .
You are given a sequence consisting of positive and negative elements (there is no zeros in the sequence).
Your task is to choose maximum by size (length) alternating subsequence of the given sequence (i.e. the sign of each next element is the opposite from the sign of the current element, like positive-negative-positive and so on or negative-positive-negative and so on). Among all such subsequences, you have to choose one which has the maximum sum of elements.
In other words, if the maximum length of alternating subsequence is then your task is to find the maximum sum of elements of some alternating subsequence of length .
You have to answer independent test cases.
Input Format: The first line of the input contains one integer () — the number of test cases. Then test cases follow.
The first line of the test case contains one integer () — the number of elements in . The second line of the test case contains integers (), where is the -th element of .
It is guaranteed that the sum of over all test cases does not exceed ().
Output Format: For each test case, print the answer — the maximum sum of the maximum by size (length) alternating subsequence of .
Note: In the first test case of the example, one of the possible answers is .
In the second test case of the example, one of the possible answers is .
In the third test case of the example, one of the possible answers is .
In the fourth test case of the example, one of the possible answers is .