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;
double pref[200500];
int a[200500], n;
double maxx(double x) {
  pref[0] = 1.0 * a[0] - x;
  for (int i = 1; i < n; ++i) {
    pref[i] = pref[i - 1] + (1.0 * a[i] - x);
  }
  double mn = 0, mx = 0, res = 0;
  for (int i = 0; i < n; ++i) {
    if (fabs(pref[i] - mn) > res) res = fabs(pref[i] - mn);
    if (pref[i] < mn) mn = pref[i];
    if (fabs(pref[i] - mx) > res) res = fabs(pref[i] - mx);
    if (pref[i] > mx) mx = pref[i];
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  double l = 0, r = 200000;
  while (r - l > 0.0000000001) {
    double m1 = l + (r - l) / 3.0;
    double m2 = l + 2.0 * (r - l) / 3.0;
    if (maxx(m1 - 100000) > maxx(m2 - 100000))
      l = m1;
    else
      r = m2;
  }
  cout << fixed << setprecision(8);
  cout << maxx(l - 100000) << '\n';
  return 0;
}
