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.*;
import java.awt.geom.*;
import java.io.*;
import java.math.*;

public class Main
{

  public static void main(String[] args)
  {
    long startTime = System.nanoTime();
    int n=in.nextInt();
    double [] sequence = new double[n];
    for(int i=0;i<n;i++)
        sequence[i]=in.nextInt();
    out.println(f(sequence,ternarySearch(10000,0,0.000001,sequence)));
    long endTime = System.nanoTime();
    err.println("Execution Time : +" + (endTime-startTime)/1000000 + " milli secs");
    exit(0);
  }



  static double f(double [] sequence,double x)
  {
    double sum=0;
    double max_sum=0;
    for(int i=0;i<sequence.length;i++)
    {
        if(Math.abs(sum+sequence[i]-x) > Math.abs(sum))
        {
            sum+=(sequence[i]-x);
           // out.println(sequence[i] + " " + x + " " +(sequence[i]-x));
        }
        else
        {
            sum=(sequence[i]-x);
        }
        max_sum=Math.max(max_sum,Math.abs(sum));
    }
    return max_sum;
  }
  

  static double ternarySearch(double left,double right,double absolutePrecision,double [] sequence)
  {
//Find minimum of unimodal function f() within [left, right]
    //To find the  maximum, reverse the if/else statement or reverse the comparison.
    while(true)
    {
        if(Math.abs(left-right) < absolutePrecision) 
            return (left+right)/2;
        double leftThird = left + (right - left)/3;
        double rightThird = right - (right - left)/3;        
        if(f(sequence,leftThird) > f(sequence,rightThird))
        {
            left = leftThird;
        }
        else
        {
            right = rightThird;
        }
    }
  }


  static class InputReader
  {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble(){
           return Double.parseDouble(next());
        }
    }


    static void exit(int a)
    {
      out.close();
      err.close();
      System.exit(a);
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static OutputStream errStream = System.err;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);
    static PrintWriter err = new PrintWriter(errStream);

}
