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 long long int dx[] = {0, 1, -1, 0, 1, -1, -1, 1};
const long long int dy[] = {-1, 0, 0, 1, 1, 1, -1, -1};
long long int gcd(long long int x, long long int y) {
  return (y != 0 ? gcd(y, x % y) : x);
}
long long int lcm(long long int x, long long int y) {
  return (x / gcd(x, y) * y);
}
int n;
int v[200010];
double normal[200010], inv[200010];
double func(double x) {
  for (int i = 0; i < n; i++) {
    normal[i] = v[i] - x;
    inv[i] = -normal[i];
  }
  double m1 = -1000000000, m2 = -1000000000;
  double sum1 = 0, sum2 = 0;
  for (int i = 0; i < n; i++) {
    sum1 += normal[i];
    m1 = max(m1, sum1);
    sum1 = max(sum1, 0.0);
    sum2 += inv[i];
    m2 = max(m2, sum2);
    sum2 = max(sum2, 0.0);
  }
  return max(m1, m2);
}
int main() {
  cout << fixed << setprecision(50);
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  double lo = 0, hi = 1e12, mid1, mid2;
  for (int k = 0; k < 300; k++) {
    mid1 = (lo * 2 + hi) / 3.0;
    mid2 = (lo + hi * 2) / 3.0;
    if (func(mid1) > func(mid2))
      lo = mid1;
    else
      hi = mid2;
  }
  cout << func(lo) << "\n";
  return 0;
}
