Problem: You are given a sequence of n integers a1, a2, ..., an. 

Determine a real number x such that the weakness of the sequence a1 - x, a2 - x, ..., an - x is as small as possible.

The weakness of a sequence is defined as the maximum value of the poorness over all segments (contiguous subsequences) of a sequence.

The poorness of a segment is defined as the absolute value of sum of the elements of segment.

Input

The first line contains one integer n (1 ≤ n ≤ 200 000), the length of a sequence.

The second line contains n integers a1, a2, ..., an (|ai| ≤ 10 000).

Output

Output a real number denoting the minimum possible weakness of a1 - x, a2 - x, ..., an - x. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

3
1 2 3


Output

1.000000000000000


Input

4
1 2 3 4


Output

2.000000000000000


Input

10
1 10 2 9 3 8 4 7 5 6


Output

4.500000000000000

Note

For the first case, the optimal value of x is 2 so the sequence becomes  - 1, 0, 1 and the max poorness occurs at the segment "-1" or segment "1". The poorness value (answer) equals to 1 in this case. 

For the second sample the optimal value of x is 2.5 so the sequence becomes  - 1.5, - 0.5, 0.5, 1.5 and the max poorness occurs on segment "-1.5 -0.5" or "0.5 1.5". The poorness value (answer) equals to 2 in this case.

Solution (in JAVA):

Solution:
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.io.Writer;
import java.util.Arrays;
import java.util.Collections;
import java.util.InputMismatchException;

public class WeaknessAndPoorness {

    
    public static void main(String[] args) {
        InputReader ir = new InputReader(System.in);
        int n = ir.nextInt();
        int a[] = new int[n];
        int maxA = 0, minA = 0;
        for (int i = 0; i < n; ++i) {
            a[i] = ir.nextInt();
            maxA = i == 0 ? a[0] : Math.max (maxA, a[i]);
            minA = i == 0 ? a[0] : Math.min (minA, a[i]);
        }
        
        Solution solution = new Solution(n, a);
        double x = solution.getMin(minA, maxA);
        OutputWriter ow = new OutputWriter(System.out);
        ow.printLine(x);
        ow.close();
    }

}

class Solution {
    private int n, a[];
    private static double EPS = 1e-6;
    public static int MAXA = 10000;
    Solution(int n, int a[]) {
        this.n = n;
        this.a = a;
    }
    double function1(double x) {
        double result = 0.0, current = 0.0;
        for (int i = 0; i < n; ++i) {
        	current += a[i] - x;
        	if (current < 0.0) {
        		current = 0.0;
        	} else if (current > result){
        		result = current;
        	}
        }
        return result;
    }

    double function2(double x) {
        double result = 0.0, current = 0.0;
        for (int i = 0; i < n; ++i) {
        	current += -a[i] + x;
        	if (current < 0.0) {
        		current = 0.0;
        	} else if (current > result){
        		result = current;
        	}
        }
        return result;
    }
    
    double getMin(double left, double right) {
    	for (int i = 0; i < 100; ++i) {
    		double middle = (left+right)/2;
    		double function1Value = function1(middle);
    		double function2Value = function2(middle); 
    		if (function1Value > function2Value) {
    			left = middle;
    		} else {
    			right = middle;
    		}
    	}
    	return Math.max(function1((left+right)/2), function2((left+right)/2));
    }
}

class InputReader {
    private InputStream stream;
    private byte[] buffer = new byte[10000];
    private int cur;
    private int count;

    public InputReader(InputStream stream) {
        this.stream = stream;
    }

    public static boolean isSpace(int c) {
        return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
    }

    public int read() {
        if (count == -1) {
            throw new InputMismatchException();
        }
        try {
            if (cur >= count) {
                cur = 0;
                count = stream.read(buffer);
                if (count <= 0)
                    return -1;
            }
        } catch (IOException e) {
            throw new InputMismatchException();
        }
        return buffer[cur++];
    }

    public int readSkipSpace() {
        int c;
        do {
            c = read();
        } while (isSpace(c));
        return c;
    }

    public int nextInt() {
        int sgn = 1;
        int c = readSkipSpace();
        if (c == '-') {
            sgn = -1;
            c = read();
        }
        int res = 0;
        do {
            if (c < '0' || c > '9') {
                throw new InputMismatchException();
            }
            res = res * 10 + c - '0';
            c = read();
        } while (!isSpace(c));
        res *= sgn;
        return res;
    }

}


class OutputWriter {
    private final PrintWriter writer;

    public OutputWriter(OutputStream outputStream) {
        writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
    }

    public OutputWriter(Writer writer) {
        this.writer = new PrintWriter(writer);
    }

    public void print(Object... objects) {
        for (int i = 0; i < objects.length; i++) {
            if (i != 0) {
                writer.print(' ');
            }
            writer.print(objects[i]);
        }
    }

    public void printLine(Object... objects) {
        print(objects);
        writer.println();
    }

    public void close() {
        writer.close();
    }

}