#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);
}
