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 <bits/stdc++.h>
using namespace std;
typedef long double ld;
const ld eps = 0.000000001;
const int maxsize = 200'000;
int n;
vector <ld> a(maxsize);
ld func(ld x)
{
    ld sum1 = 0, sum2 = 0, ans1 = a[0] - x, ans2 = x - a[0];
    for (int i = 0; i < n; i++)
    {
        sum1 += a[i] - x;
        sum2 += x - a[i];
        ans1 = max(ans1, sum1);
        ans2 = max(ans2, sum2);
        sum1 = max((ld) 0, sum1);
        sum2 = max((ld) 0, sum2);
    }
    return max(ans1, ans2);
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    ld l = -20'000, r = -l;
    while (r - l > eps)
    {
        ld k = (r - l) / 3;
        ld m1 = l + k, m2 = r - k;
        if (func(m1) > func(m2))
            l = m1;
        else
            r = m2;
        /*cout << l << " " << r << endl;*/
    }
    cout << fixed << setprecision(8) << l;
    return 0;
}