| IU Programming Challenge 2024 |
|---|
| Finished |
You are given an array $$$a$$$ consisting of $$$n$$$ integers. A nonempty contiguous subarray from $$$l$$$ to $$$r$$$ ($$$1 \leq l \leq r \leq n$$$) has the average value $$$V(l, r) = \frac{1}{r - l + 1} \sum_{i=l}^r a_i$$$. Find the average value of subarray average values. In other words, find the average value of $$$V(l, r)$$$ over all $$$1 \leq l \leq r \leq n$$$.
The first line contains an integer $$$t$$$ ($$$1 \leq t \leq 10^4)$$$ — the number of test cases.
The first line of each test case contains an integer $$$n$$$ ($$$1 \leq n \leq 2\cdot10^5$$$) — the length of the array $$$a$$$.
The second line of each test case contains $$$n$$$ space-separated integers $$$a_1, a_2, \dots, a_n$$$ ($$$1 \leq a_i \leq 10^9$$$) — the array $$$a$$$.
It's guaranteed that the sum of $$$n$$$ over all test cases is at most $$$2\cdot10^5$$$.
For each test case, output the average of subarray averages as a real number.
Your answer will be considered correct if its absolute or relative error does not exceed $$$10^{-6}$$$. Formally, if the jury's answer is $$$a$$$ and your answer is $$$b$$$, then for $$$b$$$ to be considered correct, $$$\frac{|b - a|}{\max(|a|, 1)} \leq 10^{-6}$$$.
241 2 3 415
2.500000000000000 5.000000000000000
| Name |
|---|


