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;
bool cmp(pair<pair<int, int>, int> p1, pair<pair<int, int>, int> p2) {
  if (p1.first.second != p2.first.second)
    return p1.first.second > p2.first.second;
  else
    return p1.first.first > p2.first.first;
}
long long gcd(long long a, long long b) {
  if (a % b == 0)
    return b;
  else
    return gcd(b, a % b);
}
long long fastexpo(long long a, long long b) {
  long long res = 1;
  while (b > 0) {
    if (b % 2 == 1)
      res = ((res) % 100000000019 * (a) % 100000000019 + 100000000019) %
            100000000019;
    a = ((a) % 100000000019 * (a) % 100000000019 + 100000000019) % 100000000019;
    b /= 2;
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  double lo = -500000;
  double hi = 500000;
  while ((hi - lo) >= 0.0000001) {
    double l1 = lo + (hi - lo) / (double)3;
    double l2 = lo + (2 * (hi - lo)) / (double)3;
    double ansl1 = 0, ansl2 = 0;
    double mi = 0, ma = 0;
    double k = 0;
    for (int i = 0; i < n; i++) {
      k += l1 - (double)v[i];
      if (k > 0) {
        ma = max(ma, k);
      }
      mi = min(mi, k);
      if (ma - mi > ansl1) {
        ansl1 = ma - mi;
      }
    }
    mi = 0;
    ma = 0;
    k = 0;
    for (int i = 0; i < n; i++) {
      k += l2 - (double)v[i];
      if (k > 0) {
        ma = max(ma, k);
      }
      mi = min(mi, k);
      if (ma - mi > ansl2) {
        ansl2 = ma - mi;
      }
    }
    ma = 0;
    mi = 0;
    k = 0;
    for (int i = 0; i < n; i++) {
      k += (double)v[i] - l1;
      if (k > 0) {
        ma = max(ma, k);
      }
      mi = min(mi, k);
      if (ma - mi > ansl1) {
        ansl1 = ma - mi;
      }
    }
    ma = 0;
    mi = 0;
    k = 0;
    for (int i = 0; i < n; i++) {
      k += (double)v[i] - l2;
      if (k > 0) {
        ma = max(ma, k);
      }
      mi = min(mi, k);
      if (ma - mi > ansl2) {
        ansl2 = ma - mi;
      }
    }
    if (ansl1 < ansl2) {
      hi = l2;
    } else
      lo = l1;
  }
  double mi = 0, ma = 0, k = 0;
  double fans = 0;
  for (int i = 0; i < n; i++) {
    k += lo - (double)v[i];
    if (k > 0) {
      ma = max(ma, k);
    }
    mi = min(mi, k);
    if (ma - mi > fans) {
      fans = ma - mi;
    }
  }
  mi = 0;
  ma = 0;
  k = 0;
  for (int i = 0; i < n; i++) {
    k += (double)v[i] - lo;
    if (k > 0) {
      ma = max(ma, k);
    }
    mi = min(mi, k);
    if (ma - mi > fans) {
      fans = ma - mi;
    }
  }
  std::cout << std::setprecision(6) << std::fixed;
  cout << fans << "\n";
  return 0;
}
