text: out; FastReader in = new FastReader(inputStream); Output out = new Output(outputStream); CWeaknessAndPoorness solver = new CWeaknessAndPoorness(); solver.solve(1, in, out); out.close(); System.err.println(System.currentTimeMillis()-startTime+"ms"); } } public static void main(String[] args) throws Exception { Thread thread = new Thread(null, new TaskAdapter(), "", 1<<28); thread.start(); thread.join(); } static class CWeaknessAndPoorness { int n; double[] arr; public CWeaknessAndPoorness() { } public double f(double x) { double[] cur = new double[n]; for(int i = 0; i<n; i++) { cur[i] = arr[i]-x; } return Math.max(Math.abs(Utilities.minSum(cur)), Math.abs(Utilities.maxSum(cur))); } public void solve(int kase, InputReader in, Output pw) { n = in.nextInt(); arr = new double[n]; for(int i = 0; i<n; i++) { arr[i] = in.nextInt(); } double l = -10000, r = 10000; while(r-l>1e-12) { double a = l+(r-l)/3, b = r-(r-l)/3; double x = f(a), y = f(b); if(x<y) { r = b; }else if(x>y) { l = a; }else { l = a; r = b; } } // Utilities.Debug.dbg(l); pw.printf("%.6f\n", f(l)); } } static class FastReader implements InputReader { final private int BUFFER_SIZE = 1<<16; private DataInputStream din; private byte[] buffer; private int bufferPointer; private int bytesRead; public FastReader(InputStream is) { din = new DataInputStream(is); buffer = new byte[BUFFER_SIZE]; bufferPointer = bytesRead = 0; } public int nextInt() { int ret = 0; byte c = skipToDigit(); boolean neg = (c=='-'); if(neg) { c = read(); } do { ret = ret*10+c-'0'; } while((c = read())>='0'&&c<='9'); if(neg) { return -ret; } return ret; } private boolean isDigit(byte b) { return b>='0'&&b<='9'; } private byte skipToDigit() { byte ret; while(!isDigit(ret = read())&&ret!='-') ; return ret; } private void fillBuffer() { try { bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); }catch(IOException e) { e.