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>
const long double eps = 0.000000001;
long double calc(std::vector<long double> &v) {
  long double res = v[0];
  long double now = 0;
  for (int i = 0; i < v.size(); ++i) {
    now += v[i];
    if (now < 0) {
      now = 0;
    }
    if (res < now) {
      res = now;
    }
  }
  return res;
}
void reverse_values(std::vector<long double> &v) {
  for (long double &x : v) {
    x = -x;
  }
}
void update(std::vector<long double> &v, long double value, bool up) {
  for (long double &x : v) {
    if (up) {
      x -= value;
    } else {
      x += value;
    }
  }
}
void solve() {
  std::vector<long double> prs, numbers;
  int n;
  std::cin >> n;
  prs.resize(n, 0);
  numbers.resize(n);
  for (long double &x : numbers) {
    std::cin >> x;
  }
  for (int i = 0; i < n; ++i) {
    prs[i] = numbers[i];
  }
  long double left = -2000000000, right = 2000000000;
  while (std::abs(right - left) > eps) {
    long double middle = (left + right) / 2;
    update(numbers, middle, true);
    long double pos = calc(numbers);
    reverse_values(numbers);
    long double neg = calc(numbers);
    reverse_values(numbers);
    update(numbers, middle, false);
    if (pos > neg) {
      left = middle;
    } else {
      right = middle;
    }
  }
  std::cout << std::setprecision(9) << std::fixed;
  update(numbers, left, true);
  std::cout << calc(numbers) << std::endl;
}
int main() {
  solve();
  return 0;
}
