Problem Statement
Snuke has read his own fortune for tomorrow, and learned that there are $N$ scenarios that can happen, one of which will happen tomorrow with equal probability. The $i$-th scenario will cost him $A_i$ yen (Japanese currency).
Following this, Snuke has decided to get insurance today. If he pays $x$ yen to his insurance company, he will get compensation of $\min(A_i,2x)$ yen when $A_i$ yen is lost. Here, he can choose any non-negative real number as $x$.
Snuke wants to minimize the expected value of the amount of money he loses, which is $x+A_i-\min(A_i,2x)$. Find the minimized value.
Constraints
$1 \leq N \leq 10^5$$1 \leq A_i \leq 10^9$- All values in input are integers.
Input
Input is given from Standard Input in the following format:
N
A_1 A_2 \cdots A_N
Output
Print the answer. Your answer will be judged correct when its absolute or relative error is at most $10^{-6}$.
样例
3
3 1 4
1.83333333333333333333
10
866111664 178537096 844917655 218662351 383133839 231371336 353498483 865935868 472381277 579910117
362925658.10000000000000000000
题面与样例版权归 AtCoder 及出题人所有;中文翻译由 AI 生成(CI 管线),如有出入请以原文为准。