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 c>
struct rge {
  c b, e;
};
template <class c>
rge<c> range(c i, c j) {
  return rge<c>{i, j};
}
template <class c>
auto dud(c* x) -> decltype(cerr << *x, 0);
template <class c>
char dud(...);
struct debug {
  template <class c>
  debug& operator<<(const c&) {
    return *this;
  }
};
vector<char*> tokenizer(const char* args) {
  char* token = new char[111];
  strcpy(token, args);
  token = strtok(token, ", ");
  vector<char*> v({token});
  while (token = strtok(NULL, ", ")) v.push_back(token);
  return reverse(v.begin(), v.end()), v;
}
void debugg(vector<char*> args) { cerr << "\b\b "; }
template <typename Head, typename... Tail>
void debugg(vector<char*> args, Head H, Tail... T) {
  debug() << " [" << args.back() << ": " << H << "] ";
  args.pop_back();
  debugg(args, T...);
}
int mod = 998244353;
const int MX = 0x3f3f3f3f;
int n;
double a[int(2e5)];
double check(double x) {
  double temp = 0, ma = 0, mi = 0, sum = 0;
  int i;
  for (i = 0; i <= n - 1; i++) {
    temp = a[i] - x;
    ma = max(ma + temp, temp);
    mi = min(mi + temp, temp);
    sum = max({sum, ma, -mi});
  }
  return sum;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cout << fixed << setprecision(10);
  int i;
  for (i = 0; i <= n - 1; i++) cin >> a[i];
  double l = -10000, r = 10000;
  double ans;
  while (r - l > 1e-9) {
    double m1 = l + (r - l) / 3;
    double m2 = r - (r - l) / 3;
    double f1 = check(m1);
    double f2 = check(m2);
    if (f1 > f2)
      ans = f2, l = m1;
    else
      ans = f1, r = m2;
  }
  cout << ans;
  return 0;
}
