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;
inline void rd(int &x) {
  x = 0;
  char c;
  while (c = getchar(), c < 48)
    ;
  do x = x * 10 + (c & 15);
  while (c = getchar(), c > 47);
}
int n;
long long a[200005], sum[200005];
long long Ans = 1e9;
long long solve(long long x) {
  long long ans = -1e18, res = 1e18;
  int id = 0, ii = 0;
  for (int i = 1; i <= n; ++i) {
    sum[i] = sum[i - 1] + a[i] - x;
    ans = max(ans, sum[i] - sum[id]);
    if (sum[i] < sum[id]) id = i;
    res = min(res, sum[i] - sum[ii]);
    if (sum[i] > sum[ii]) ii = i;
  }
  ans = max(ans, -res);
  Ans = min(ans, Ans);
  return ans;
}
bool chk(long long x) {
  if (solve(x) > solve(x + 1))
    return true;
  else
    return false;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    a[i] <<= 1;
  }
  long long L = -1e6, R = 1e6;
  while (L <= R) {
    long long mid = (L + R) >> 1;
    if (chk(mid))
      L = mid + 1;
    else
      R = mid - 1;
  }
  cout << Ans / 2 << ".";
  cout << (Ans & 1 ? '5' : '0') << "000000000000" << endl;
  return 0;
}
