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 MAXN = 7005;
const double long EPS = 1e-12;
const double long INF = 1e9;
vector<int> ARR, ARR1;
int N;
double long largest1(double long x, vector<int> A) {
  double long max_h = -0, max_s = -INF;
  for (int i = 0; i < N; i++) {
    max_h += A[i] - x;
    max_s = max(max_s, max_h);
    if (max_h < 0) max_h = 0;
  }
  return max_s;
}
double long largest2(double long x, vector<int> A) {
  double long max_h = -0, max_s = -INF;
  for (int i = 0; i < N; i++) {
    max_h += A[i] + x;
    max_s = max(max_s, max_h);
    if (max_h < 0) max_h = 0;
  }
  return max_s;
}
double long sum(double long x) {
  double long s1 = largest1(x, ARR);
  double long s2 = largest2(x, ARR1);
  s1 = max(s1, -s1);
  s2 = max(s2, -s2);
  return max(s1, s2);
}
double long ternary(double long lo, double long hi) {
  while (hi - lo > EPS) {
    double long m1 = lo + (hi - lo) / 3;
    double long m2 = hi - (hi - lo) / 3;
    if (sum(m1) < sum(m2))
      hi = m2;
    else
      lo = m1;
  }
  return hi;
}
int main() {
  scanf("%d", &N);
  for (int i = 0; i < N; i++) {
    int u;
    scanf("%d", &u);
    ARR.push_back(u);
  }
  int MIN = 1e4;
  int MAX = -1e4;
  for (int i = 0; i < N; i++) {
    MIN = min(MIN, ARR[i]);
    MAX = max(MAX, ARR[i]);
  }
  for (int i = 0; i < N; i++) ARR1.push_back(-ARR[i]);
  double long ans = ternary(MIN, MAX);
  ans = sum(ans);
  printf("%Lf", ans);
}
