#C3231. Minimum Photograph Time
Minimum Photograph Time
Minimum Photograph Time
You are given several test cases. In each test case, there are N trees and each tree has some birds. You need to determine the minimum amount of time required to photograph all the birds if it takes exactly 1 unit of time to photograph each bird.
The time required for a test case is given by the formula:
\( T = \sum_{i=1}^{N} a_i \)
where ai is the number of birds perched on the i-th tree.
For example, if there are 3 trees with 2, 3, and 4 birds respectively then the minimum time required is 9 time units.
inputFormat
The input starts with an integer T representing the number of test cases. For each test case, the first line contains an integer N representing the number of trees. The next line contains N space-separated integers, where each integer represents the number of birds on that tree.
Input Format: T N a1 a2 ... aN ... (repeated for each test case)
outputFormat
For each test case, output a single line containing the minimum amount of time required to photograph all the birds.
Output Format: result1 result2 ...## sample
1
3
2 3 4
9
</p>