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 java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @author Don Li
 */
public class WeaknessAndPoorness {

    int n;
    double[] A;
    double[] B;

    void solve() {
        n = in.nextInt();
        A = new double[n];
        for (int i = 0; i < n; i++) A[i] = in.nextDouble();
        B = new double[n];

        double l = -1e4, r = 1e4;
        for (int i = 0; i < 200; i++) {
            double m1 = l + (r - l) / 3.0;
            double m2 = r - (r - l) / 3.0;
            if (f(m1) >= f(m2)) l = m1;
            else r = m2;
        }
        out.println(f((l + r) / 2.0));
    }

    private double f(double x) {
        for (int i = 0; i < n; i++) B[i] = A[i] - x;
        double res = maxSubsequence(B);
        for (int i = 0; i < n; i++) B[i] = -B[i];
        res = Math.max(res, maxSubsequence(B));
        return res;
    }

    private double maxSubsequence(double[] A) {
        int n = A.length;
        double maxEndingHere = A[0], max = A[0];
        for (int i = 1; i < n; i++) {
            maxEndingHere = Math.max(A[i], maxEndingHere + A[i]);
            max = Math.max(max, maxEndingHere);
        }
        return max;
    }

    public static void main(String[] args) {
        in = new FastScanner(new BufferedReader(new InputStreamReader(System.in)));
        out = new PrintWriter(System.out);
        new WeaknessAndPoorness().solve();
        out.close();
    }

    static FastScanner in;
    static PrintWriter out;

    static class FastScanner {
        BufferedReader in;
        StringTokenizer st;

        public FastScanner(BufferedReader in) {
            this.in = in;
        }

        public String nextToken() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(in.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() {
            return Double.parseDouble(nextToken());
        }
    }
}
