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

public class WeaknessandPoorness {
    private static double getOpt(double arr[]) {
        double opt = 0;
        
        for(int x = 0; x < arr.length; x++) opt += arr[x];
        
//        double ifOdd = arr[arr.length / 2];
//        double ifEven = arr[arr.length / 2] + arr[(arr.length / 2) - 1];
//        double mid = (arr.length % 2 == 0)?ifEven/2:ifOdd;
        
        return opt / arr.length;
    }
    public static void main(String[] args) {
   
        Scanner in = new Scanner(System.in);
        int s;
        
        do {
            s = in.nextInt();
        }
        while(s <1 || s > 200000);
        
        double sec[] = new double[s];
        
        for (int x = 0; x < s; x++){
            do{
                sec[x] = in.nextInt();
            }
            while(Math.abs(sec[x]) > 10000);
        }
        
        double opt = getOpt(sec);
        double maxPoorness = 0;
        
        for (int x = 0; x < s; x++){
            sec[x] = sec[x] - opt;
            System.out.println(sec[x]);
        }
        
        for (int x = 0; x < s - 1; x++){
           
            if (Math.abs(sec[x] + sec[x + 1]) > maxPoorness) {
                maxPoorness = Math.abs(sec[x] + sec[x + 1]);
            }
        }
        
        System.out.println(maxPoorness);

    }
}
