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;
double a[200009];
int n;
long double calc(long double x) {
  long double ans = 0;
  long double cur = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i] - x;
    if (cur < 0) cur = 0;
    ans = max(cur, ans);
  }
  cur = 0;
  for (int i = 0; i < n; i++) {
    cur += a[i] - x;
    if (cur > 0) cur = 0;
    ans = max(-cur, ans);
  }
  return ans;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", a + i);
  }
  long double lo = -10001, hi = 10001;
  for (int i = 0; i < 100; i++) {
    auto m1 = lo + (hi - lo) / 3.0;
    auto m2 = hi - (hi - lo) / 3.0;
    auto f1 = calc(m1);
    auto f2 = calc(m2);
    if (f1 > f2)
      lo = m1;
    else
      hi = m2;
  }
  long double ans = calc(lo);
  printf("%f\n", (double)ans);
}
