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

#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define IO(i, o) freopen(i, "r", stdin), freopen(o, "w", stdout)
using namespace __gnu_pbds;
using namespace std;

int n, a[200000];

long double check(long double x){
	long double cmx = 0, mx = 0, cmn = 0, mn = 0;
	for(int i = 0; i < n; i++){
		cmx += a[i] - x, cmn += a[i] - x;
		if(cmx < 0) cmx = 0;
		if(cmn > 0) cmn = 0;
		mn = min(mn, cmn);
		mx = max(mx, cmx);
	}
	return max(-mn, mx);
}

int main(){
	//IO("input.txt", "output.txt");
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> n;
	for(int i = 0; i < n; i++) cin >> a[i];
	int l = -1e4, r = 1e4;
	while(l < r){
		int mid1 = l + (r - l) / 3;
		int mid2 = r - (r - l) / 3;
		long double val1 = check(mid1 / 2.0);
		long double val2 = check(mid2 / 2.0);
		if(val1 == val2) l = mid1 + 1, r = mid2 - 1;
		else if(val1 > val2) l = mid1 + 1;
		else r = mid2 - 1;
	}
	cout << fixed << setprecision(9) << check(l / 2.0) << '\n';
	return 0;
}