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.*;
import java.util.*;
import java.util.List;

public class Main {
    private static StringTokenizer st;
    private static BufferedReader br;
    public static long MOD = 1000000007;
    private static double EPS = 0.00000001;

    public static void print(Object x) {
        System.out.println(x + "");
    }
    public static void printArr(long[] x) {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < x.length; i++) {
            s.append(x[i] + " ");
        }
        print(s);
    }
    public static void printArr(int[] x) {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < x.length; i++) {
            s.append(x[i] + " ");
        }
        print(s);
    }
    public static void printArr(char[] x) {
        StringBuilder s = new StringBuilder();
        for (int i = 0; i < x.length; i++) {
            s.append(x[i] + "");
        }
        print(s);
    }
    public static String join(Collection<?> x, String space) {
        if (x.size() == 0) return "";
        StringBuilder sb = new StringBuilder();
        boolean first = true;
        for (Object elt : x) {
            if (first) first = false;
            else sb.append(space);
            sb.append(elt);
        }
        return sb.toString();
    }

    public static String nextToken() throws IOException {
        while (st == null || !st.hasMoreTokens()) {
            String line = br.readLine();
            st = new StringTokenizer(line.trim());
        }
        return st.nextToken();
    }
    public static int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }
    public static long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }
    public static double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }
    public static List<Integer> nextInts(int N) throws IOException {
        List<Integer> ret = new ArrayList<Integer>();
        for (int i = 0; i < N; i++) {
            ret.add(nextInt());
        }
        return ret;
    }

    public static double weakness(int[] aInt, double x) {
        int n = aInt.length;
        double[] a = new double[n];
        for (int i = 0; i < n; i++) a[i] = aInt[i]-x;

        double ans = Math.max(max(a), max(negative(a)));
        //print(ans + " for " + x);
        return ans;
    }
    public static double max(double[] a) {
        double minPref = 0;
        double total = 0;
        double max = 0;
        for (double x : a) {
            total += x;
            minPref = Math.min(minPref, total);
            max = Math.max(max, total - minPref);
        }
        return max;
    }
    public static double[] negative(double[] a) {
        int n = a.length;
        double[] negative = new double[n];
        for (int i = 0; i < n; i++) negative[i] = -a[i];
        return negative;
    }

    public static double solve(int[] a, double left, double right) {
        double mid = (left+right) / 2;
        if (right - left < EPS) return weakness(a, mid);
        if (weakness(a, mid) < weakness(a, mid - EPS))
            return solve(a, mid, right);
        else
            return solve(a, left, mid);
    }

    public static void main(String[] args) throws IOException {
        br = new BufferedReader(new InputStreamReader(System.in));

        int n = nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) a[i] = nextInt();

        print(solve(a, -11000, 11000));
    }
}