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.text.DecimalFormat;
import java.text.NumberFormat;
import java.util.StringTokenizer;

public class TaskC {

    public static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
    public static StringTokenizer tok = null;
    public static double phi = (1.0 + Math.sqrt(5.0)) / 2.0;

    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[] minToHere;
    public static double[] maxToHere;
    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();
//            a[i] = 10000;
        }

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

        double low = -10000;
        double high = 10000;

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

//        double value = ((long)(low * 100_000_000L)) / 100_000_000.0;
//        System.out.println(value);
        double resultValue = f1;
        double result = ((long)(resultValue * 100000L)) / 100000.0;
        NumberFormat formatter = new DecimalFormat("#0.00000000");
        System.out.println(formatter.format(result).replace(',', '.'));
    }

    public static double findValue(int[] a, double x, int n) {
        minToHere[0] = a[0] - x;
        maxToHere[0] = minToHere[0];
        for (int i = 1; i < n; i++) {
            double value = a[i] - x;
            minToHere[i] = Math.min(value, minToHere[i - 1] + value);
            maxToHere[i] = Math.max(value, maxToHere[i - 1] + value);
        }

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