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 = 200010;
long double a[N];
int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  int n;
  long double ans;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  long double st = -10010, en = 10010;
  for (int t = 0; t < 70; t++) {
    long double m = (st + en) / 2;
    long double minn = 0, maxx = 0, sum = 0;
    for (int i = 0; i < n; i++) {
      sum += a[i] + m;
      minn = min(minn, sum);
      maxx = max(maxx, sum);
    }
    vector<int> v[2];
    if (minn == 0) v[0].push_back(-1);
    if (maxx == 0) v[1].push_back(-1);
    ans = maxx - minn;
    sum = 0;
    for (int i = 0; i < n; i++) {
      sum += a[i] + m;
      if (sum == minn) v[0].push_back(i);
      if (sum == maxx) v[1].push_back(i);
    }
    if (v[0].back() <= v[1][0]) en = m;
    if (v[1].back() <= v[0][0]) st = m;
  }
  cout << fixed << setprecision(10) << ans << endl;
  return 0;
}
