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

//package temp;
import java.util.*;
public class ty {
	static int n;
	static int[] a;
	public static void main(String args[]){
		Scanner s=new Scanner(System.in);
		n=s.nextInt();
		a=new int[n];
		for(int i=0;i<n;i++){
			a[i]=s.nextInt();
		}
		double l=-10000;
		double r=10000;
		while(Math.abs(r-l)>=1e-8){
			double m1=l+(r-l)/3;
			double m2=r-(r-l)/3;
			if(f(m1)>f(m2)){
				l=m1;
			}
			else{
				r=m2;
			}
		}
		System.out.printf("%.6f\n",f(l));
	}
	
	  private static double weakness(int[] a, double x) {
	        double maxSum = Integer.MIN_VALUE;
	        double minSum = Integer.MAX_VALUE;

	        double curMax = 0;
	        double curMin = 0;
	        for (int anA : a) {
	            curMax += (anA - x);
	            curMin += (anA - x);
	            if (curMax > maxSum) {
	                maxSum = curMax;
	            }
	            if (curMin < minSum) {
	                minSum = curMin;
	            }
	            if (curMax < 0) {
	                curMax = 0;
	            }
	            if (curMin > 0) {
	                curMin = 0;
	            }
	        }
	        return Math.max(Math.abs(minSum), Math.abs(maxSum));
	    }
	
	static double f(double x){
		double sum=0,ans=0;
		for (int i = 0; i < n; i++){
			sum+=a[i]-x;
			if(sum>ans)ans=sum;
			if(sum<0)sum=0;
	    }
		sum=0;
		for(int i=0;i<n;i++){
			sum+=-a[i]+x;
			if(sum>ans)ans=sum;
			if(sum<0)sum=0;
		}
		return ans;
	}
}
