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 N = 2e5 + 7;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const double EPS = 1e-8;
const double PI = acos(-1.0);
int a[N];
bool same(double a, double b) {
  if (a >= 0 && b >= 0) return true;
  if (a <= 0 && b <= 0) return true;
  return false;
}
int main(void) {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  double l = -100000, r = 100000;
  double Ans = 0;
  while (r - l > EPS) {
    double mid = (l + r) / 2;
    double sum = a[1] - mid;
    double A = 0, B = 0;
    if (sum < 0) A = abs(sum);
    if (sum > 0) B = abs(sum);
    for (int i = 2; i <= n; ++i) {
      if (same(sum, a[i] - mid)) {
        sum += a[i] - mid;
      } else {
        sum = a[i] - mid;
      }
      if (sum < 0) A = max(A, -sum);
      if (sum > 0) B = max(B, sum);
    }
    if (A < B)
      l = mid;
    else
      r = mid;
    Ans = max(A, B);
  }
  printf("%.15lf\n", Ans);
  return 0;
}
