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<iostream>
#include<cstring>
#include<cstdio>
const int maxn = 200000;
const double inf = 2 * 1e9 + 10;
const double eps = 1e-9;
using namespace std;

int n, sum[maxn + 5], q;

double abs(double a){return a > 0 ? a : -a;}

double calc(double x)
{
	double maxx = -inf, minn = inf;
	for(int i = 0; i <= n; i ++){
		maxx = max(maxx, sum[i] - x * double(i));
		minn = min(minn, sum[i] - x * double(i));
	}
	return maxx - minn;
}

double triple()
{
	double l = -10005, r = 10005;
	double mid1, mid2;
	do{
		mid1 = (l + r) / 2, mid2 = (mid1 + r) / 2;
		int a1 = calc(mid1), a2 = calc(mid2);
		if(a1 + eps< a2) r = mid2;
		else if(a2 - eps > a1)l = mid1;
		else break;
	}while(abs(calc(r) - calc(l)) >= eps);
	return calc(l);
}

int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= n; i ++){
		scanf("%d", &q);
		sum[i] = sum[i - 1] + q;
	}
	printf("%.10lf", triple());
}