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>
inline bool getmin(T *a, const T &b) {
  if (b < *a) {
    *a = b;
    return true;
  }
  return false;
}
template <class T>
inline bool getmax(T *a, const T &b) {
  if (b > *a) {
    *a = b;
    return true;
  }
  return false;
}
template <class T>
inline void read(T *a) {
  char c;
  while (isspace(c = getchar())) {
  }
  bool flag = 0;
  if (c == '-')
    flag = 1, *a = 0;
  else
    *a = c - 48;
  while (isdigit(c = getchar())) *a = *a * 10 + c - 48;
  if (flag) *a = -*a;
}
const int mo = 1000000007;
template <class T>
T pow(T a, T b, int c = mo) {
  T res = 1;
  for (T i = 1; i <= b; i <<= 1, a = 1LL * a * a % c)
    if (b & i) res = 1LL * res * a % c;
  return res;
}
const int N = 210000;
double a[N];
int n;
double check(double x) {
  double tmp = 0, res = 0;
  for (int i = (1); i <= (n); ++i) {
    tmp = max(a[i] - x, tmp + a[i] - x);
    getmax(&res, tmp);
  }
  tmp = 0;
  for (int i = (1); i <= (n); ++i) {
    tmp = min(a[i] - x, tmp + a[i] - x);
    getmax(&res, -tmp);
  }
  return res;
}
int main() {
  cin >> n;
  for (int i = (1); i <= (n); ++i) read(a + i);
  double l = -2e9, r = 2e9, ans = 2e9;
  for (int tt = (1); tt <= (200); ++tt) {
    double m1 = (l + r) / 2;
    double m2 = (m1 + r) / 2;
    double fl = check(l), fr = check(r), f1 = check(m1), f2 = check(m2);
    getmin(&ans, fl);
    getmin(&ans, f1);
    getmin(&ans, f2);
    getmin(&ans, fr);
    if (f1 < f2)
      r = m2;
    else
      l = m1;
  }
  printf("%.10lf\n", ans);
  return 0;
}
