


The first line contains an integer 'T’, which denotes the number of Test cases.
The next '2' * 'T' lines represent the ‘T’ test cases.
The first line of each test case contains two single space-separated integers 'N' and 'M' denoting the size of the gold mine.
The second line of each test case contains 'N' * 'M' space-separated integers representing the gold mine.
For each test case print an integer 'X' denoting the maximum amount of gold collected.
Output for each test case will be printed in a separate line.
You are not required to print the output, it has already been taken care of. Just implement the function.
1 <= T <= 10
1 <= N <= 100
1 <= M <= 100
0 <= gold at each cell <= 10^5
Time Limit: 1 sec
Finally, in the end, we will be getting maximum of gold collected starting from each row of the first column in the main function. We will be returning maximum of all those amounts.
For this question, we cannot use the greedy approach as it is not necessary that the maximum start would give the maximum total.
Hence we chose the bottom-up approach of dynamic programming.