#K6331. Average Waiting Time
Average Waiting Time
Average Waiting Time
You are given an integer \(M\) representing the number of road segments and \(M\) integers where the \(i^{th}\) integer indicates the number of cars waiting at the \(i^{th}\) road segment. The average waiting time is defined as the total number of cars divided by \(M\). Compute the average waiting time and output it as a floating point number rounded to 6 decimal places.
Note: The result should be formatted to exactly 6 decimal places even if trailing zeros are required (e.g., 7.000000).
inputFormat
The input is given via standard input (stdin) and consists of two lines:
- The first line contains an integer \(M\), the number of road segments.
- The second line contains \(M\) space-separated integers representing the number of cars at each road segment.
outputFormat
Output the average waiting time as a floating point number rounded to 6 decimal places. The result should be printed to standard output (stdout).
## sample4
5 10 15 20
12.500000
</p>