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 Main {
    public static void main(String[] args) {
        Solver solver = new Solver();
        solver.solve();
    }
}

class Solver {
    Scanner stdin = new Scanner(System.in);
    final int MAXN = 200000 + 5;
    int[] a = new int[MAXN];
    double[] b = new double[MAXN];
    final double INF = 1e7;
    final double EPS = 1e-8;
    
    double poorness(int n, double x) {
        b[0] = 0.0;
        for (int i = 1; i <= n; i++) {
            b[i] = b[i - 1] + a[i] - x;
        }
        double max = b[1];
        double min = b[1];
        double res = 0.0;
        for (int i = 2; i <= n; i++) {
            res = Math.max(res, Math.abs(b[i] - max));
            res = Math.max(res, Math.abs(b[i] - min));
            max = Math.max(max, b[i]);
            min = Math.min(min, b[i]);
        }
        return res;
    }
    
    void solve() {
        int n = stdin.nextInt();
        for (int i = 1; i <= n; i++)
            a[i] = stdin.nextInt();
        double x = 0.0;
        for (int i = 1; i <= n; i++)
            x += a[i];
        x /= n;
        System.out.printf("%.12f\n", poorness(n, x));
    }
}