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;
int save[200000];
int n;
void work(double begin, double end) {
  double middle1 = begin + (end - begin) / 3.0;
  double middle2 = begin + (end - begin) / 3.0 * 2.0;
  double min1 = 0.0, max1 = 0.0;
  for (int i = 0; i < n; i++) {
    double temp = save[i] - (i + 1) * middle1;
    if (temp > max1) max1 = temp;
    if (temp < min1) min1 = temp;
  }
  double ans1 = max1 - min1;
  double min2 = 0.0, max2 = 0.0;
  for (int i = 0; i < n; i++) {
    double temp = save[i] - (i + 1) * middle2;
    if (temp > max2) max2 = temp;
    if (temp < min2) min2 = temp;
  }
  double ans2 = max2 - min2;
  if (end - begin < 0.0000000001) {
    double middle = begin + (end - begin) / 2.0;
    double minl = 0.0, maxl = 0.0;
    for (int i = 0; i < n; i++) {
      double temp = save[i] - (i + 1) * middle;
      if (temp > maxl) maxl = temp;
      if (temp < minl) minl = temp;
    }
    double ans = maxl - minl;
    cout << ans << endl;
    return;
  }
  if (ans1 > ans2)
    work(middle1, end);
  else
    work(begin, middle2);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    if (i == 0)
      save[i] = temp;
    else
      save[i] = temp + save[i - 1];
  }
  work(-10000.0, 10000.0);
}
