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;
vector<long double> narr;
inline int grad(double& x) {
  long double mn = 0, mx = 0;
  int p1 = 0, p2 = 0;
  long double val = 0;
  for (int i = 1; i < (int)narr.size(); ++i) {
    val += narr[i] - x;
    if (val < mn) {
      mn = val;
      p1 = i;
    }
    if (val > mx) {
      mx = val;
      p2 = i;
    }
  }
  if (p1 < p2)
    return -1;
  else if (p1 > p2)
    return 1;
  else
    return 0;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<int> arr(n);
  for (int i = 0; i < (int)n; ++i) scanf("%d", &arr[i]);
  narr.push_back(0.0);
  for (int i = 0; i < (int)n; ++i) narr.push_back(arr[i]);
  for (int i = 0; i < (int)n; ++i) narr[i + 1] = narr[i] + arr[i];
  double l = -1e4, r = 1e4;
  int cnt = 0;
  while (r - l >= 1e-8 && ++cnt < 100) {
    double mid = (r + l) / 2.0;
    int g = grad(mid);
    if (g < 0)
      l = mid;
    else if (g > 0)
      r = mid;
    else {
      l = r = mid;
      break;
    }
  }
  double val = (r + l) / 2.0;
  long double mn = 0, mx = 0;
  for (int i = 1; i < (int)narr.size(); ++i) {
    mn = min(mn, narr[i] - val * i);
    mx = max(mx, narr[i] - val * i);
  }
  long double res = mx - mn;
  cout << fixed << setprecision(10) << res << endl;
  return 0;
}
