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;
const int inf = (int)1e9 + 7;
const long long INF = (long long)1e18 + 7;
const int N = 1234567;
const int M = 1010;
int n;
double a[N], b[N];
void readInput() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
  }
}
double F(double x) {
  double sum = 0;
  double smax = 0, smin = 0;
  double res = 0;
  for (int i = 1; i <= n; i++) {
    b[i] = a[i] - x;
  }
  for (int i = 1; i <= n; i++) {
    sum += b[i];
    smax = max(smax, sum);
    smin = min(smin, sum);
    res = max(res, max(abs(sum - smax), abs(sum - smin)));
  }
  return res;
}
void Solve() {
  double left = -1e9, right = 1e9;
  for (int it = 0; it < 200; it++) {
    double x1 = left + (right - left) / 3.0;
    double x2 = right - (right - left) / 3.0;
    if (F(x1) > F(x2)) {
      left = x1;
    } else {
      right = x2;
    }
  }
  cout << F(left) << '\n';
}
int main() {
  ios_base ::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(10);
  cout << fixed;
  readInput();
  Solve();
  return 0;
}
