#C14924. Differences from Average Calculation
Differences from Average Calculation
Differences from Average Calculation
Given a list of integers, compute the difference between each element and the average of the list. Let the list be \(L = [a_1, a_2, \ldots, a_n]\), and the average be \(\mu = \frac{1}{n}\sum_{i=1}^{n}a_i\). For each element \(a_i\) in the list, calculate \(d_i = round(a_i - \mu, 1)\). When the list is empty, output an empty result.
Your task is to read the input from standard input (stdin) and write the result to standard output (stdout).
inputFormat
The input consists of two parts:
- The first line contains a non-negative integer \(n\) representing the number of elements.
- If \(n > 0\), the second line contains \(n\) space-separated integers.
outputFormat
Output \(n\) space-separated floating-point numbers on one line. Each number should represent the difference (rounded to one decimal place) between the corresponding input integer and the average of all input integers. If \(n = 0\), output nothing.
## sample5
10 12 14 16 18
-4.0 -2.0 0.0 2.0 4.0