#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
using namespace std;
#define re(i, n) for (int i=0; i<n; i++)
#define re1(i, n) for (int i=1; i<=n; i++)
#define re2(i, l, r) for (int i=l; i<r; i++)
#define re3(i, l, r) for (int i=l; i<=r; i++)
#define rre(i, n) for (int i=n-1; i>=0; i--)
#define rre1(i, n) for (int i=n; i>0; i--)
#define rre2(i, r, l) for (int i=r-1; i>=l; i--)
#define rre3(i, r, l) for (int i=r; i>=l; i--)
#define ll long long
const double zero = 1e-7;
const int MAXN = 300010, INF = ~0U >> 2;
int n, A[MAXN];
double res;
void init()
{
scanf("%d", &n);
rre(i, n) scanf("%d", &A[i]);
}
void solve()
{
double x0 = 0, x1 = 0, m1 = A[0], x2 = 0, m2;
re2(i, 1, n-1) {
m2 = A[i];
x2 = (m1 * x2 + m2 * (x2 - 1)) / (m1 + m2);
m1 += m2;
}
if (n > 1) x2 -= 1; res = x1 - x2; m1 = A[0];
re2(i, 1, n-1) {
x1 = x0 + 1; m2 = A[i]; x0 = (m1 * x0 + m2 * x1) / (m1 + m2);
m1 += m2; x2 += (m2 + m2) / m1;
if (x1 - x2 - zero > res) res = x1 - x2 - zero;
}
if (res < -zero) res = 0;
}
void pri()
{
printf("%.6lf\n", res);
}
int main()
{
init();
solve();
pri();
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RkaW8uaD4KI2luY2x1ZGUgPHN0ZGxpYi5oPgojaW5jbHVkZSA8c3RyaW5nLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CiNkZWZpbmUgcmUoaSwgbikgZm9yIChpbnQgaT0wOyBpPG47IGkrKykKI2RlZmluZSByZTEoaSwgbikgZm9yIChpbnQgaT0xOyBpPD1uOyBpKyspCiNkZWZpbmUgcmUyKGksIGwsIHIpIGZvciAoaW50IGk9bDsgaTxyOyBpKyspCiNkZWZpbmUgcmUzKGksIGwsIHIpIGZvciAoaW50IGk9bDsgaTw9cjsgaS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