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 + 25;
const long double eps = 1e-7;
int n, a[N];
long double b[N], s[N];
long double f(long double first) {
  long double mx = -1e18, mn = 1e18, max_sum = 0, min_sum = 0;
  for (int i = 1; i <= n; ++i) {
    b[i] = a[i];
    b[i] -= first;
    s[i] = s[i - 1] + b[i];
    mx = max(mx, s[i] - min_sum);
    min_sum = min(min_sum, s[i]);
    mn = min(mn, s[i] - max_sum);
    max_sum = max(max_sum, s[i]);
  }
  return max(abs(mx), abs(mn));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  long double l = -1e18, r = 1e18;
  while (r - l > eps) {
    long double m1 = l + (r - l) / 3;
    long double m2 = r - (r - l) / 3;
    if (f(m1) > f(m2))
      l = m1;
    else
      r = m2;
  }
  cout.precision(6);
  cout << fixed << f(l);
}
