10
-405 -230 252 -393 -390 -259 97 163 81 -129
 3
10000 -10000 10000
 1
-10000
 20
-16 -23 29 44 -40 -50 -41 34 -38 30 -12 28 -44 -49 15 50 -28 38 -2 0

702.333333333333712
 10000.000000000016371
 0.000000000000000
 113.875000000000043

#include <iostream>
#include <set>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <set>
#include <cstring>
#include <map>
#include <ctime>
#include <stdio.h>

using namespace std;

#define ll long long
#define sc second
#define fs first
#define mp make_pair

ll m[300000], a[20002], n;
int sgn[300000];
long double dp[2][200000];

long double f(long double x)
{
    long double ans = 0;
    int i = 0;
    memset(dp, 0, sizeof(dp));
    if ((long double)m[0] - x > 1e-11)
        dp[0][0] = (long double)m[0] - x;
    if ((long double)m[0] - x < -1e-11)
        dp[1][0] = (long double)m[0] - x;
    for (int i = 1; i < n; i++)
    {
        long double cur = (long double)m[i] - x;
        dp[0][i] = max(dp[0][i - 1] + cur, (long double)0.000000000000000000);
        dp[1][i] = min(dp[1][i - 1] + cur, (long double)0.000000000000000000);
    }
    for (int i = 0; i < n; i++)
    {
        ans = max(ans, dp[0][i]);
        ans = max(ans, fabs(dp[1][i]));
    }
    return ans;
}

int main()
{
    cin >> n;
    memset(a, 0, sizeof(a));
    for (int i = 0; i < n; i++)
        cin >> m[i];
    long double l = -1e9, r = 1e9, EPS = 1e-10, ans = 1e18;
    while (r - l > EPS) {
        long double m1 = l + (r - l) / 3,
            m2 = r - (r - l) / 3;
        long double f1 = f(m1), f2 = f(m2);
        if (f1 > f2)
            l = m1;
        else
            r = m2;
    }
    ans = min(ans, f(l));
    printf("%.9f", ans);
    return 0;
}