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 tong(double x, vector<double> a) {
  double maxt = 0, mint = 0, s = 0;
  for (int i = 0; i < a.size(); i++) {
    s += a[i] - x;
    maxt = max(s, maxt);
    mint = min(s, mint);
  }
  return abs(maxt - mint);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  vector<double> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  double l = -20000, r = 20000;
  for (int i = 0; i < 100; i++) {
    double l1 = (l + l + r) / 3;
    double r1 = (l + r + r) / 3;
    if (tong(l1, a) > tong(r1, a)) {
      l = l1;
    } else
      r = r1;
  }
  cout << setprecision(6) << fixed << tong(l, a);
  return 0;
}
