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.InputStreamReader;
import java.util.StringTokenizer;


public class Problem578C {

	static BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
	static StringTokenizer st = new StringTokenizer("");
	
	public static void main(String[] args) throws Exception {
		int[] a1 = new int[200000];
		int n = readInt();
		double l=-10000,r=10000,md,b,c,d;
		double a = 0.0;
		for(int i=0; i<n; i++){
			a1[i] = readInt();
		}
		while(r-l>0.0000001){
			md=(l+r)/2;
			a = -10001;
			b = 10001;
			c=d=0;
			for(int i = 0; i < n; i++){
				c+=a1[i]-md;
				if(c<0){
					c=0;
				}
				if(c>a){
					a=c;
				}
				d+=a1[i]-md;
				if(d>0){
					d=0;
				}
				if(d<b){
					b=d;
				}
			}
			if(a+b>0){
				l=md;
			} else {
				r=md;
			}
		}
//		a = Math.round(a * 1000000d)/ 100000d;
		System.out.println(a);
	}
	
	static String readString() throws Exception {
		while(!st.hasMoreTokens())
			st = new StringTokenizer(stdin.readLine());
		return st.nextToken();
	}

	static int readInt() throws Exception {
		return Integer.parseInt(readString());
	}

	static double readDouble() throws Exception {
		return Double.parseDouble(readString());
	}

}
