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 V[200020];
double poverty(double x) {
  double sum1 = 0, maxSum = 0, sum2 = 0, minSum = 0;
  for (int i = 0; i < N; ++i) {
    sum1 = max(sum1 + V[i] - x, 0.);
    maxSum = max(sum1, maxSum);
    sum2 = min(sum2 + V[i] - x, 0.);
    minSum = min(sum2, minSum);
  }
  return max(maxSum, -minSum);
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; ++i) {
    scanf("%lg", &V[i]);
  }
  poverty(1.0);
  poverty(2.0);
  poverty(3.0);
  double a = *min_element(V, V + N);
  double b = *max_element(V, V + N);
  double eps = 1e-8;
  double phi = (sqrt(5.0) - 1.0) * 0.5;
  double x1 = b - (b - a) * phi;
  double x2 = a + b - x1;
  double y1 = poverty(x1);
  double y2 = poverty(x2);
  int count = 0;
  while (abs(b - a) > eps) {
    if (count % 10 == 0) {
      x1 = b - (b - a) * phi;
      x2 = a + b - x1;
      y1 = poverty(x1);
      y2 = poverty(x2);
    }
    if (y1 >= y2) {
      a = x1;
      x1 = x2;
      y1 = y2;
      x2 = a + b - x1;
      y2 = poverty(x2);
    } else {
      b = x2;
      x2 = x1;
      y2 = y1;
      x1 = a + b - x2;
      y1 = poverty(x1);
    }
  }
  printf("%-.10lg\n", poverty((a + b) * 0.5));
}
