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.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;


public class CF_320_E {
    
    private static double p(int[] arr1, double mid){
        
        double[] arr = new double[arr1.length];
        
        for(int i = 0; i < arr.length; i++){
            arr[i] = (double)arr1[i] - mid;
        
        }
        int index = 0;
        while(index < arr.length && arr[index] < 0)index++;
        double max = Integer.MIN_VALUE;
        double cum = 0;
        for(int i = index; i < arr.length; i++){
            if(arr[i] >= 0){
                cum += arr[i];
                max = Math.max(max, cum);
            }else{
                if(cum + arr[i] <= 0){
                    cum = 0;
                }else{
                    cum += arr[i];
                }
            }
        }
        
        //-ve
        for(int i = 0; i < arr.length; i++){
            arr[i] *= -1;
        
        }
            
        
         index = 0;
    
        while(index < arr.length && arr[index] < 0)index++;
        double max1 = Integer.MIN_VALUE;
        cum = 0;
        for(int i = index; i < arr.length; i++){
        
            if(arr[i] >= 0){
                cum += arr[i];
                max1 = Math.max(max1, cum);
            }else{
                if(cum + arr[i] <= 0){
                    cum = 0;
                }else{
                    cum += arr[i];
                }
            }
        }
        
    
        if(max == Integer.MIN_VALUE){
            return -1*max1;
        }else if(max1 == Integer.MIN_VALUE){
            return max;
        }
        return (max > max1)? max:-1*max1;
    }
    
    public static void main(String[] args) throws IOException{
        PrintWriter pw = new PrintWriter(System.out, true);
        BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
        String[] line;
        int n = Integer.parseInt(input.readLine());
        int[] N = new int[n];
        line = input.readLine().split(" ");
        for(int i = 0; i < n; i++){
            N[i] = Integer.parseInt(line[i]);
        }
        double lo = -100001, hi = 100001, mid;
        double val;
        
        while((hi-lo) > 1e-9){
        
            
            mid = lo+(hi-lo)/2;
        
            val = p(N, mid);
    
        
            if(val < 0){
                hi = mid;
            }else{
                lo = mid;
            }
        }
        if(n == 1){
            pw.println(0);
        }else{
            pw.println(Math.abs(p(N, lo)));
        }
        
        pw.close();
        input.close();
    }
}
