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

/**
 * Created by Никита on 04.10.2015.
 */
public class PureAndWeakness {
    public static void main(String... args) {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        try {
            int n = Integer.parseInt(reader.readLine());
            String[] str = reader.readLine().split(" ");
            double[] data = new double[n];
            for(int i = 0; i < n; i++)
                data[i] = Integer.parseInt(str[i]);
            double[] data1 = data.clone();
            Arrays.sort(data1);
            double mode = n % 2 == 0 ? (data1[n/2 - 1] + data1[n/2] + 0.0)/2 : data1[n/2];
            for(int i = 0; i < n; i++) data[i] -= mode;
            double maxModule = 0;
            for(int i = 0; i < n; i++) {
                double sum = 0;
                for(int j = i; j < n; j++) {
                    sum += data[j];
                    if(Math.abs(sum) > maxModule)
                        maxModule = Math.abs(sum);
                }
            }
            System.out.print(maxModule);
        } catch(IOException e) {

        }
    }
}
