Problem: You are given a sequence of n integers a1, a2, ..., an. 

Determine a real number x such that the weakness of the sequence a1 - x, a2 - x, ..., an - x is as small as possible.

The weakness of a sequence is defined as the maximum value of the poorness over all segments (contiguous subsequences) of a sequence.

The poorness of a segment is defined as the absolute value of sum of the elements of segment.

Input

The first line contains one integer n (1 ≤ n ≤ 200 000), the length of a sequence.

The second line contains n integers a1, a2, ..., an (|ai| ≤ 10 000).

Output

Output a real number denoting the minimum possible weakness of a1 - x, a2 - x, ..., an - x. Your answer will be considered correct if its relative or absolute error doesn't exceed 10 - 6.

Examples

Input

3
1 2 3


Output

1.000000000000000


Input

4
1 2 3 4


Output

2.000000000000000


Input

10
1 10 2 9 3 8 4 7 5 6


Output

4.500000000000000

Note

For the first case, the optimal value of x is 2 so the sequence becomes  - 1, 0, 1 and the max poorness occurs at the segment "-1" or segment "1". The poorness value (answer) equals to 1 in this case. 

For the second sample the optimal value of x is 2.5 so the sequence becomes  - 1.5, - 0.5, 0.5, 1.5 and the max poorness occurs on segment "-1.5 -0.5" or "0.5 1.5". The poorness value (answer) equals to 2 in this case.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
inline int two(int n) { return 1 << n; }
inline int test(int n, int b) { return (n >> b) & 1; }
inline void set_bit(int& n, int b) { n |= two(b); }
inline void unset_bit(int& n, int b) { n &= ~two(b); }
inline int last_bit(int n) { return n & (-n); }
inline int ones(int n) {
  int res = 0;
  while (n && ++res) n -= n & (-n);
  return res;
}
long long int gcd(long long int a, long long int b) {
  return (a ? gcd(b % a, a) : b);
}
long long int modPow(long long int a, long long int b, long long int MOD) {
  long long int x = 1, y = a;
  while (b > 0) {
    if (b % 2 == 1) {
      x = (x * y) % MOD;
    }
    b /= 2;
    y = (y * y) % MOD;
  }
  return x;
}
long long int modInverse(long long int a, long long int p) {
  return modPow(a, p - 2, p);
}
using namespace std;
const int N = 2e5 + 5;
long long int arr[N];
long long int n;
long double F(long double x) {
  long double brr[N];
  for (int i = 0; i < (n); i++) brr[i] = (long double)(arr[i] - x);
  long double prevsum = brr[0];
  long double maxx = abs(brr[0]);
  long long int idx = 1;
  while (idx < n) {
    if (abs(prevsum + brr[idx]) >= maxx) {
      maxx = abs(prevsum + brr[idx]);
      prevsum = prevsum + brr[idx];
    } else {
      maxx = max(abs(prevsum), abs(brr[idx]));
      prevsum = brr[idx];
    }
    idx++;
  }
  return maxx;
}
long double F2(long double x) {
  long double ans = 0.0, sum1 = 0.0, sum2 = 0.0, zero = 0.0;
  for (int i = 0; i < n; i++) {
    sum1 += arr[i] - x;
    sum2 += x - arr[i];
    sum1 = max(zero, sum1);
    sum2 = max(zero, sum2);
    ans = max(ans, sum1);
    ans = max(ans, sum2);
  }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int i, j, k;
  cin >> n;
  for (int i = 0; i < (n); i++) cin >> arr[i];
  long double hi, lo, mid1, mid2;
  lo = -1e6;
  hi = 1e6;
  cout << setprecision(10) << fixed;
  ;
  for (int i = 0; i < (200); i++) {
    mid1 = (lo * 2 + hi) / 3.0;
    mid2 = (lo + 2 * hi) / 3.0;
    if (F2(mid2) > F2(mid1))
      hi = mid2;
    else
      lo = mid1;
  }
  cout << F2(lo);
  return 0;
}