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.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author kevindra
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskE solver = new TaskE();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskE {
        public double maxAbsSubarraySum(int[] a, int n, double x, boolean positive) {
            // now find the max cont. subseq sum
            //double [] minDP = new double[n+1];
            double[] maxDP = new double[n + 1];

            for (int i = 1; i <= n; i++) {
                if (i == 1) {
                    //minDP[i] = a[i] - x;
                    maxDP[i] = Math.max(0, (a[i] - x) * (positive ? 1 : -1));
                } else {
                    //minDP[i] = Math.min(minDP[i-1] + a[i] - x, a[i] - x);
                    maxDP[i] = Math.max(0, Math.max(maxDP[i - 1] + (a[i] - x) * (positive ? 1 : -1), (a[i] - x) * (positive ? 1 : -1)));
                }
            }
            //return Math.max(Math.abs(minDP[n]), Math.abs(maxDP[n]));
            return Math.abs(maxDP[n]);
        }

        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[200001];
            double min = 10001, max = -10001;
            for (int i = 1; i <= n; i++) {
                a[i] = in.nextInt();
                min = Math.min(min, a[i]);
                max = Math.max(max, a[i]);
            }

            double ans = maxAbsSubarraySum(a, n, 0, true);
            for (int step = 0; step < 500; step++) {
                double mid = (min + max) / 2;
                double psum = maxAbsSubarraySum(a, n, mid, true);
                double nsum = maxAbsSubarraySum(a, n, mid, false);

                ans = Math.min(ans, Math.max(psum, nsum));
                if (psum > nsum) max = mid;
                else min = mid;
            }

            out.printf("%.15f", ans);
        }

    }
}

