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.*;
public class Solution {
	static class FastReader {
        BufferedReader br; 
        StringTokenizer st; 
        public FastReader() {
        	boolean env=System.getProperty("ONLINE_JUDGE") != null;
        	if(!env) {
        		try {
					br=new BufferedReader(new FileReader("src\\input.txt"));
				} catch (FileNotFoundException e) {
					e.printStackTrace();
				}
        	}
        	else br = new BufferedReader(new InputStreamReader(System.in)); 
        } 
        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) {
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
        int nextInt() {
            return Integer.parseInt(next()); 
        } 
        long nextLong() {
            return Long.parseLong(next()); 
        } 
        double nextDouble() {
            return Double.parseDouble(next()); 
        } 
        String nextLine() {
            String str = ""; 
            try {
                str = br.readLine(); 
            } 
            catch (IOException e) {
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
	static FastReader sc=new FastReader();
	static PrintWriter out=new PrintWriter(System.out);
	//Main
	static int n;
	static double a[],eps=1e-11;;
	static double kadane(double arr[]) {
		double cur=0,res=0;
		for(int i=0;i<n;i++) {
			cur=Math.max(cur+arr[i], arr[i]);
			res=Math.max(res, cur);
		}
		return res;
	}
	static double check(double x) {
		double tmp[]=new double[n];
		for(int i=0;i<n;i++) tmp[i]=a[i]-x;
		double ans1=kadane(tmp);
		for(int i=0;i<n;i++) tmp[i]*=-1;
		double ans2=kadane(tmp);
		return Math.max(ans1, ans2);
	}
	public static void main(String args[]) {
		int test=1;
		//test=sc.nextInt();
		while(test-->0) {
			//Focus
			n=sc.nextInt();a=new double[n];
			double min=Double.MAX_VALUE,max=Double.MIN_VALUE;
			for(int i=0;i<n;i++) {
				a[i]=sc.nextDouble();
				min=Math.min(min, a[i]);
				max=Math.max(max, a[i]);
			}
			double l=min,r=max;
			for(int i=0;i<=100;i++) {
				double m1=l+(r-l)/3,m2=r-(r-l)/3;
				double f1=check(m1),f2=check(m2);
				if(f2<f1) l=m1;
				else r=m2;
			}
			double ans=Math.min(check(l), Math.min(check((l+r)/2), check(r)));
			out.printf("%.12f",ans);
		}
		out.flush();
		out.close();
	}
}
