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

/*
        #############################
        # Problems :#
        #                           #
        #      Author : Adhambek    #
        #############################
*/
#define _CRT_DISABLE_PERFCRIT_LOCKS
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <string.h>
#include <vector>
#include <math.h>
#include <time.h>
#include <queue>
#include <map>
#include <set>
#define get() _getchar_nolock()
#define put(c) _putchar_nolock(c)
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fr first
#define sc second
const int INF =  2000000007;
const int inf = -2000000007;
const int mod = 1000000007;
const int mxs = 100100;

using namespace std;

template <typename T> T gcd(T a, T b){ return a != 0 ? gcd(b % a, a) : b;}
template <typename T> T lcm(T a, T b){ return a / gcd(a, b) * b;}
typedef __int64 ll;
typedef double  dl;
int node[mxs << 4];
int prv[mxs << 4];
int cur[mxs];
int startNode;
void add(int u, int v){
    node[ ++ startNode] = u;
    prv[startNode] = cur[v];
    cur[v] = startNode;
}

void solve(int task);
void solve();
int main(){
    int t = 1;
    //scanf("%d", &t);
    for(int i = 1; i <= t; i ++){
        solve();
    }
}
int n;
int a[mxs << 1];
double buf[mxs << 1];
double getT(double x){
    for(int i = 0; i < n; i ++)
        buf[i] = a[i] - x;
    double sum = 0; 
    double ans = 0;
    for(int i = 0; i < n; i ++){
        sum += buf[i];
        if(sum < 0) sum = 0;
        ans = max(sum, ans);
    }
    for(int i = 0; i < n; i ++)
        buf[i] *= -1;
    sum = 0;
    for(int i = 0; i < n; i ++){
        sum += buf[i];
        if(sum < 0) sum = 0;
        ans = max(sum, ans);
    }
    return ans;
}
void solve(){
    scanf("%d",&n);
    for(int i = 0; i < n; i ++)
        scanf("%d", a + i);
    double l = 0, r = 10001;
    for(int i = 0; i < 100; i ++){
        double m1 = (2 * l + r) / 3.;
        double m2 = (2 * r + l) / 3.;
        if(getT(m1) > getT(m2)) l = m1;
        else r = m2;
    }
    l = (l + r) / 2.;
    printf("%.9lf",getT(l));
}