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;
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
double f(const vector<int> &a, double x) {
  double s = 0.0, mins = 0, maxs = 0;
  for (int i = 0; i < (int)(a.size()); ++i) {
    s += a[i] + x;
    uin(mins, s);
    uax(maxs, s);
  }
  return maxs - mins;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < (int)(N); ++i) cin >> a[i];
  double l = -1e9, r = 1e9;
  int A = 11, B = 10;
  for (int its = 0; its < (int)(100); ++its) {
    double m1 = (A * l + B * r) / (A + B);
    double m2 = (B * l + A * r) / (A + B);
    double f1 = f(a, m1), f2 = f(a, m2);
    if (f1 < f2)
      r = m2;
    else
      l = m1;
  }
  cout << f(a, l) << '\n';
  return 0;
}
