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

import static java.lang.Math.*;
import static java.lang.System.currentTimeMillis;
import static java.lang.System.exit;
import static java.lang.System.arraycopy;
import static java.util.Arrays.sort;
import static java.util.Arrays.binarySearch;
import static java.util.Arrays.fill;
import java.util.*;
import java.io.*;

public class Main {
    public static void main(String[] args) throws IOException {
        new Main().run();       
    }

    BufferedReader in;
    PrintWriter out;
    StringTokenizer st = new StringTokenizer("");

    private void run() throws IOException {
        if (new File("input.txt").exists())
            in = new BufferedReader(new FileReader("input.txt"));
        else
            in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        solve();
        in.close();
        out.close();
    }
    
    final int N = 1000 * 1000;
    
    final double EPS = 1e-10;
    
    
    int n = 0;
    
    double a[];
    
    private void solve() throws IOException {
        
        n = nextInt();
        a = new double[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        
        double l = -1e20;
        double r = 1e20;
        double fl = f(l);
        double fr = f(r);
        
        while (!check(l, r, EPS) || !check(fl, fr, EPS)) {
            double m1 = (l * 2. + r) / 3.;
            double m2 = (r * 2. + l) / 3.;
            double fm1 = f(m1);
            double fm2 = f(m2);
            
            if (fm1 < fm2) {
                r = m2;
                fr = fm2;
            }
            else {
                l = m1;
                fl = fm1;
            }
        }
        
        out.printf(Locale.US, "%.15f", fl);
        
    }
    
    boolean check(double l, double r, double eps) {
        
        if (abs(l - r) < eps)
            return true;
        if ((abs(l - r) / (abs(l) + abs(r))) < eps)
            return true;
        
        return false;
    }
    
    double f(double m) {
        
        double ret = 0.;
        double min = 0.;
        double max = 0.;
        
        double sum = 0.;
        
        for (int i = 0; i < n; i++) {
            sum += a[i] - m;
            
            ret = max(ret, abs(sum - min));
            ret = max(ret, abs(sum - max));
            
            min = min(min, sum);
            max = max(max, sum);
        }
        
        return ret;
    }
    
    
    
    void chk(boolean b) {
        if (b)
            return;
        System.out.println(new Error().getStackTrace()[1]);
        exit(999);
    }
    void deb(String fmt, Object... args) {
        System.out.printf(Locale.US, fmt + "%n", args);
    }
    String nextToken() throws IOException {
        while (!st.hasMoreTokens())
            st = new StringTokenizer(in.readLine());
        return st.nextToken();
    }
    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    String nextLine() throws IOException {
        st = new StringTokenizer("");
        return in.readLine();
    }
    boolean EOF() throws IOException {
        while (!st.hasMoreTokens()) {
            String s = in.readLine();
            if (s == null)
                return true;
            st = new StringTokenizer(s);
        }
        return false;
    }
}
