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

public class cf579e implements Runnable {
	public static final String taskname = cf579e.class.getName();
	
	public StringTokenizer strtok;
	public BufferedReader inr;
	public PrintWriter out;

	public static void main(String[] args) {
		new Thread(new cf579e()).start();
	}

	public void run() {
		Locale.setDefault(Locale.US);
		boolean oj = System.getProperty("ONLINE_JUDGE") != null;
		try {
			inr = new BufferedReader(oj ? new InputStreamReader(System.in, "ISO-8859-1") : new FileReader(taskname + ".in"));
			out = new PrintWriter(oj ? new OutputStreamWriter(System.out, "ISO-8859-1") : new FileWriter(taskname + ".out"));
			solve();
		} catch (Exception e) {
			if (!oj)
				e.printStackTrace();
			System.exit(9000);
		} finally {
			out.flush();
			out.close();
		}
	}

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

	public int nextInt() throws NumberFormatException, IOException {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws NumberFormatException, IOException {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws NumberFormatException, IOException {
		return Double.parseDouble(nextToken());
	}

	// Debugging

	public static void printArray(boolean[][] a) {
		for (int i = 0; i < a.length; i++) {
			for (int j = 0; j < a[i].length; j++) {
				System.out.print(a[i][j] ? '#' : '.');
			}
			System.out.print('\n');
		}
	}

	// Solution
	
	double find_max(int[] a, double x) {
		double ans = a[0] - x, sum = 0, min_sum = 0;
		for (int r = 0; r < a.length; ++r) {
			sum += a[r] - x;
			ans = Math.max(ans, sum - min_sum);
			min_sum = Math.min(min_sum, sum);
		}
		return ans;
	}
	
	double find_min(int[] a, double x) {
		double ans = -a[0] + x, sum = 0, min_sum = 0;
		for (int r = 0; r < a.length; ++r) {
			sum += -a[r] + x;
			ans = Math.max(ans, sum - min_sum);
			min_sum = Math.min(min_sum, sum);
		}
		return -ans;
	}
	

	public void solve() throws NumberFormatException, IOException {
		int n = nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		double x_low = -1000000, x_high = 1000000;
		while (x_high - x_low > 5e-12) {
			double x = x_low + (x_high - x_low) / 2;
			double max_v = find_max(a, x);
			double min_v = find_min(a, x);
//			System.out.printf("x=%f, min_v=%f, max_v=%f\n", x, min_v, max_v);
			if (min_v > 0 || (min_v <= 0 && max_v >= 0 && max_v >= -min_v)) {
				x_low = x;
			}
			else {
				x_high = x;
			}
		}
		out.print(find_max(a, x_low));
	}
}