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

#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pii;
typedef pair<double,double> pdd;
const double EPS=1e-9;
#define debug(c) (cerr<<#c<<": "<<c<<"\n")
#define fi first
#define se second
#define mod 1000000007
#define pi acos(-1)
#define ios ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
double a[200005];
double dp1[200005];
double dp2[200005];
ll n;
double func(double x)
{
	double max1=0.0d;
	dp1[0]=dp2[0]=0.0d;
	ll i;
	for(i=1;i<=n;i++)
	{
		dp1[i]=max(dp1[i-1]+a[i]-x,a[i]-x);
		dp2[i]=min(dp2[i-1]+a[i]-x,a[i]-x);
		max1=max(max1,abs(dp1[i]));
		max1=max(max1,abs(dp2[i]));
	}
	return max1;
}
int main()
{
	ios;
	double rg=10000.0d,l,u,res1,res2,val,x,y;
	ll i;
	cin>>n;
	for(i=1;i<=n;i++)
		cin>>a[i];
	l=-2*rg;u=2*rg;
	while((u-l)>EPS)
	{
		val=(u-l)/3;
		x=l+val;
		y=u-val;
		res1=func(x);
		res2=func(y);
		if(res1<=res2)
			u=y;
		else
			l=x;
	}
	//cout<<l<<endl;
	cout<<fixed<<setprecision(12)<<func(l)<<endl;
}
