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;
int N;
double a[200000];
double getWeakness(double x) {
  double ans = 0.0, minSoFar = 0.0, maxSoFar = 0.0;
  for (int n = 0; n < int(N); n++) {
    minSoFar = min(minSoFar, 0.0);
    maxSoFar = max(maxSoFar, 0.0);
    minSoFar += a[n] - x;
    maxSoFar += a[n] - x;
    ans = max(ans, maxSoFar);
    ans = max(ans, -minSoFar);
  }
  return ans;
}
int main() {
  scanf("%d", &N);
  for (int n = 0; n < int(N); n++) scanf("%lf", a + n);
  double minX = -20000.0, maxX = 20000.0;
  while (maxX - minX > 1e-9) {
    double ai = (1.0 / 3.0) * (maxX - minX);
    double i1 = minX + ai, i2 = minX + 2.0 * ai;
    double g1 = getWeakness(i1);
    double g2 = getWeakness(i2);
    if (g1 > g2)
      minX = i1;
    else
      maxX = i2;
  }
  printf("%.9f\n", getWeakness(0.5 * (minX + maxX)));
}
