#C8567. Calculate Average Fuel Consumption
Calculate Average Fuel Consumption
Calculate Average Fuel Consumption
You are given multiple test cases. In each test case, there are N journeys. For each journey, three integers T, C, and L denote the fuel consumption of different components. The total fuel consumption for a journey is computed as
\( T + C + L \).
Your task is to compute the average fuel consumption per test case. More formally, if a test case has N journeys and the fuel consumptions of these journeys are given by:
[ \text{Total}_j = T_j + C_j + L_j \quad \text{for } j=1,2,\dots,N, ]
then the average fuel consumption is:
[ \text{Average} = \text{round}\left( \frac{\sum_{j=1}^{N} (T_j + C_j + L_j)}{N} \right), ]
where round(x)
rounds x
to the nearest integer using standard rounding rules. Output one result for each test case on a separate line.
inputFormat
The input is read from standard input (stdin) and structured as follows:
- The first line contains an integer T representing the number of test cases.
- For each test case:
- The first line contains an integer N, the number of journeys.
- The next N lines each contain three space-separated integers T, C, and L.
outputFormat
For each test case, output a single line containing the computed average fuel consumption as an integer on standard output (stdout).
## sample2
3
30 50 10
20 40 10
40 60 20
2
15 25 10
25 35 20
93
65
</p>