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>
using namespace std;
const int maxn = 200010;
int a[maxn];
long double s[maxn], d[maxn];
int N;
long double solve(long double mid) {
  long double now = 0, MIN = 0, MAX = 0;
  for (int i = 0; i <= N; i++) {
    d[i] = s[i] + now;
    now += mid;
    if (d[i] < MIN) MIN = d[i];
    if (d[i] > MAX) MAX = d[i];
  }
  return MAX - MIN;
}
int main() {
  cin >> N;
  for (int i = 1; i <= N; i++) scanf("%d", &a[i]), s[i] = s[i - 1] + a[i];
  long double L = -10000, R = 10000;
  for (int k = 1; k <= 200; k++) {
    long double mid1 = L + (R - L) / 3.0, mid2 = R - (R - L) / 3.0;
    if (solve(mid1) < solve(mid2))
      R = mid2;
    else
      L = mid1;
  }
  printf("%.10f\n", (double)solve(L));
  return 0;
}
