#K34437. Maximum Stack Height
Maximum Stack Height
Maximum Stack Height
Riya has a collection of books where each book has a certain height. She wants to stack all the books into one single stack. The maximum stack height is simply the sum of all the book heights. Given several test cases, for each test case, you are provided with the number of books \(N\) and a list of \(N\) integers representing the heights of the books. Your task is to compute the maximum stack height for each test case, i.e. compute \(\sum_{i=1}^{N} h_i\).
inputFormat
The input is read from standard input (stdin) and is structured as follows:
- The first line contains an integer \(T\), the number of test cases.
- For each test case:
- The first line contains an integer \(N\), representing the number of books.
- The second line contains \(N\) space-separated integers representing the heights of the books.
outputFormat
For each test case, output the maximum stack height (i.e. the sum of the heights) on a separate line to standard output (stdout).
## sample1
5
3 1 4 1 5
14
</p>