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 double eps = 1e-8;
int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while ('0' <= c && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  return x * f;
}
int N;
double a[200010], b[200010], f[200010];
double calc(double x) {
  memset(f, 0, sizeof(f));
  for (int i = 1; i <= N; ++i) b[i] = a[i] + x;
  double ans = 0, res = 0;
  for (int i = 1; i <= N; ++i) {
    if (res + b[i] > 0)
      res += b[i];
    else
      res = 0;
    ans = max(ans, res);
  }
  for (int i = 1; i <= N; ++i) b[i] = -b[i];
  res = 0;
  for (int i = 1; i <= N; ++i) {
    if (res + b[i] > 0)
      res += b[i];
    else
      res = 0;
    ans = max(ans, res);
  }
  return ans;
}
int main() {
  N = read();
  for (int i = 1; i <= N; ++i) a[i] = read();
  double l = -20000, r = 20000;
  for (int cnt = 1; cnt <= 200; ++cnt) {
    double mid = (l + r) / 2;
    double q1 = calc(mid - eps), q2 = calc(mid + eps);
    if (q1 > q2)
      l = mid;
    else
      r = mid;
  }
  printf("%.7lf", calc(l));
  return 0;
}
