#C8705. Total Tickets Sold
Total Tickets Sold
Total Tickets Sold
You are given T test cases. For each test case, the first line contains an integer \(N\) which represents the number of customers. The next line contains \(N\) integers where the \(i\)-th integer represents the number of tickets that the \(i\)-th customer wants to purchase.
Your task is to compute the total number of tickets sold for each test case.
Note: The input is read from stdin
and the output should be written to stdout
. Each test case result must be printed on a new line.
Mathematically, for each test case, if the list of ticket counts is \(C_1, C_2, \dots, C_N\), you need to compute \(\sum_{i=1}^{N} C_i\).
inputFormat
The first line of the input contains an integer \(T\) denoting the number of test cases.
For each test case, the following lines are provided:
- The first line contains an integer \(N\) denoting the number of customers.
- The second line contains \(N\) space-separated integers \(C_1, C_2, \dots, C_N\) indicating the number of tickets each customer wants to buy.
It is guaranteed that \(0 \leq N \leq 10^5\) and \(0 \leq C_i \leq 10^9\) for all valid \(i\).
outputFormat
For each test case, output a single line containing one integer — the total number of tickets sold in that test case.
## sample3
3
1 2 3
4
0 0 0 0
5
5 5 5 5 5
6
0
25
</p>