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.util.StringTokenizer;

public class TaskC {

    public static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok = null;

    public static String nextToken() throws IOException {
        if (tok == null || !tok.hasMoreTokens()) {
            tok = new StringTokenizer(reader.readLine());
        }
        return tok.nextToken();
    }

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

    public static double[] values;
    public static double[] minToHere;
    public static double[] maxToHere;
    public static double[] maxModulToHere;
    public static double[] resultToHere;

    public static void main(String[] args) throws IOException {
        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }

        values = new double[n];
        minToHere = new double[n];
        maxToHere = new double[n];
        maxModulToHere = new double[n];
        resultToHere = new double[n];

        double low = -10000;
        double high = 10000;

        while (high - low >= 1e-9) {
            double m1 = low + (high - low) / 3.0;
            double m2 = high - (high - low) / 3.0;
            double f1 = findValue(a, m1, n);
            double f2 = findValue(a, m2, n);
            if (f1 < f2) {
                high = m2;
            } else {
                low = m1;
            }
        }

        System.out.println(findValue(a, high, n));
    }

    public static double findValue(int[] a, double x, int n) {
        for (int i = 0; i < n; i++) {
            values[i] = a[i] - x;
        }

        minToHere[0] = values[0];
        maxToHere[0] = values[0];
        maxModulToHere[0] = Math.abs(values[0]);
        for (int i = 1; i < n; i++) {
            minToHere[i] = Math.min(values[i], minToHere[i - 1] + values[i]);
            maxToHere[i] = Math.max(values[i], maxToHere[i - 1] + values[i]);
            maxModulToHere[i] = Math.max(Math.abs(minToHere[i]), Math.abs(maxToHere[i]));
        }

        resultToHere[0] = Math.abs(values[0]);
        for (int i = 1; i < n; i++) {
            resultToHere[i] = Math.max(resultToHere[i - 1], maxModulToHere[i]);
        }
        return resultToHere[n - 1];
    }
}
