A maximum sum subsequence of an array is subsequence whose sum is maximum with the condition that the subsequence is sorted.
Given an array, find the sum of the maximum sum subsequence of that array.
arr: [101, 4, 98, 103]
answer: 205
Explanation: 4+98+103
arr: [101, 4, 95, 103]
answer: 204
Explanation: 101+103
The first line contains an integer âTâ denoting the number of test cases.
For each test case, the input has two lines:
For each test case, the output contains a line with one integer denoting the sum of the max sum subsequence.
3
4
101 4 98 103
4
101 4 95 103
1
42
205
204
42
1 <= T <= 100
1 <= n <= 100
1 <= arri <= 1000