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.*;
import java.util.*;

public class tr2 {
	static PrintWriter out;
	static StringBuilder sb;

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		out = new PrintWriter(System.out);
		int n=sc.nextInt();
		double []a=new double [n];
		for(int i=0;i<n;i++)
			a[i]=sc.nextDouble();
		double lo=-40000;
		double hi=40000;
		double eps = 1e-11;
		double ans=0;
		while(hi-lo>eps) {
			double x1=lo+(hi-lo)/3;
			double x2=hi-(hi-lo)/3;
			double []b1=a.clone();
			double []b2=a.clone();
			for(int i=0;i<n;i++)
				b1[i]-=x1;
			for(int i=0;i<n;i++)
				b2[i]-=x2;
			double a1=trr(b1);
			double a2=trr(b2);
			if(a1<a2) {
				hi=x2;
			}
			else if(a2<=a1) {
				lo=x1;
			}
			ans=a1;
		//	System.out.println(lo+" "+hi);
		}
		out.print(ans);
		out.flush();
	}

	 static double trr(double []a) {
		  double res = 0;
		    double min = 0, max = 0, sum = 0;
		    for(int i =0 ; i<a.length; i++)
		    {
		        sum += a[i];
		        min = Math.min(min, sum);
		        max = Math.max(max, sum);
		        res = Math.max(res, Math.max(max-sum, sum-min));
		    }
		    return res;
	 }
    static double maxSum(double []a) {
    	double ans=0;
    	for(int i=0;i<a.length;i++) {
    		double sum=0;
    		if(a[i]>=0) {
    			while(i<a.length && a[i] >=0) {
    				sum+=a[i];
    				i++;
    			}
    			i--;
    		}
    		else {
    			while(i<a.length && a[i] <0) {
    				sum+=a[i];
    				i++;
    			}
    			sum*=-1;
    			i--;
    		}
    		ans=Math.max(sum, ans);
    	}
    	return ans;
    }
    static double maxSum1(double []a) {
    	double ans=0;
    	for(int i=0;i<a.length;i++) {
    		double sum=0;
    		if(a[i]>0) {
    			while(i<a.length && a[i] >0) {
    				sum+=a[i];
    				i++;
    			}
    			i--;
    		}
    		else {
    			while(i<a.length && a[i] <=0) {
    				sum+=a[i];
    				i++;
    			}
    			sum*=-1;
    			i--;
    		}
    		ans=Math.max(sum, ans);
    	}
    	return ans;
    }
	static long gcd(long a, long b) {
		if (b == 0) {
			return a;
		}
		return gcd(b, a % b);
	}

	static class unionfind {
		int[] p;
		int[] size;

		unionfind(int n) {
			p = new int[n];
			size = new int[n];

			for (int i = 0; i < n; i++) {
				p[i] = i;
			}
			Arrays.fill(size, 1);
		}

		int findSet(int v) {
			if (v == p[v])
				return v;
			return p[v] = findSet(p[v]);
		}

		boolean sameSet(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return true;
			return false;
		}

		int max() {
			int max = 0;
			for (int i = 0; i < size.length; i++)
				if (size[i] > max)
					max = size[i];
			return max;
		}

		void combine(int a, int b) {
			a = findSet(a);
			b = findSet(b);
			if (a == b)
				return;
			if (size[a] > size[b]) {
				p[b] = a;
				size[a] += size[b];

			} else {
				p[a] = b;
				size[b] += size[a];
			}
		}
	}

	static class Scanner {
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}

		public Scanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

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

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

		public char nextChar() throws IOException {
			return next().charAt(0);
		}

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

		public boolean ready() throws IOException {
			return br.ready();
		}

		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}