#K93017. Task Completion Days
Task Completion Days
Task Completion Days
You are given several tasks, each of which requires a certain number of days to complete. In each test case, the first line contains an integer N representing the number of tasks. The second line contains N space separated integers, each representing the days required to complete a task. You must complete each task consecutively, and although the problem description mentions minimizing the difference between the minimal and maximal days among consecutive tasks, it turns out that the optimal strategy is to simply perform all tasks. Therefore, your goal is to calculate the total number of days required to finish all tasks in each test case.
Input Format (stdin):
- The first line contains an integer T, the number of test cases.
- For each test case:
- The first line contains an integer N, the number of tasks.
- The second line contains N space separated integers representing the number of days for each task.
Output Format (stdout):
- For each test case, output a single line containing the total number of days required.
Example:
Input: 2 3 4 8 2 4 5 12 7 3</p>Output: 14 27
Note: The summation can be expressed mathematically as:
inputFormat
The input begins with an integer T denoting the number of test cases. For each test case, the first line contains an integer N representing the number of tasks, followed by a line with N integers. Each integer Di represents the days required to complete the i-th task.
outputFormat
For each test case, output the sum of days required to complete all tasks. Each answer should be printed on a new line.
## sample2
3
4 8 2
4
5 12 7 3
14
27
</p>