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.Scanner;
import java.lang.*;

public class SentineValue{
	public static double sum(double[] array){
		double sum=0;
		for(int i=0;i<array.length;i++)
			sum+=array[i];
			return sum;
	}
	
	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int n=in.nextInt();
			double a[]=new double[n];
			for(int i=0;i<n;i++)
				a[i]=in.nextDouble();
			double max=0;
		for(int t=1;t<=n;t++){
			for(int k=1;k<=n;k++){
				double b[]=new double[t];
				double c[]=new double[k];
				int i=0;
				int j=0;
				for(;i<=n-t;i++){
					System.arraycopy(a, i, b, 0, t);
					for(;j<=n-k;j++){
						System.arraycopy(a, j, c, 0, k);
						
						double S=(k*sum(b)-t*sum(c))/(t+k);
						if (Math.abs(S)>max)
							max=Math.abs(S);
						
					}
				}
			}
		}
		System.out.println("\n\n"+max);
	}
}