#include <stdio.h>
#include <iostream>
int n;
int A[200010];
long double a[200010],b[200010],c[200010];
long double lo,hi;
long double ans = 2e10+1.0;
long double min(long double a,long double b){
    return a<b?a:b;
}
long double max(long double a,long double b){
    return a>b?a:b;
}
long double abs(long double a){
    return a>0?a:-a;
}
long double f(){
    bool minusExist=false,plusExist=false;
    long double s1=0,s2=0;
    long double ret1=2e10+1,ret2=-2e10-1;
    for(int i=1;i<=n;i++){
        if(b[i]<0) minusExist = true;
        if(b[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=b[i];
            if(s1>0) s1 = 0;
            else if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=1;i<=n;i++){
            s2+=b[i];
            if(s2<0) s2 = 0;
            else if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
long double g(){
    bool minusExist=false,plusExist=false;
    long double s1=0,s2=0;
    long double ret1=2e10+1,ret2=-2e10-1;
    for(int i=1;i<=n;i++){
        if(c[i]<0) minusExist = true;
        if(c[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=c[i];
            if(s1>0) s1 = 0;
            else if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=1;i<=n;i++){
            s2+=c[i];
            if(s2<0) s2 = 0;
            else if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&A[i]);
        a[i] = A[i];
    }
    lo = -10100.0;
    hi = 10100.0;
    while((hi-lo)>1e-10){
        long double me1 = lo+(hi-lo)/3.0;
        long double me2 = hi-(hi-lo)/3.0;
        for(int i=1;i<=n;i++){
            b[i] = a[i]-me1;
            c[i] = a[i]-me2;
        }
        long double res1 = f();
        long double res2 = g();
        ans = min(ans,min(res1,res2));
        if(res1<res2){
            hi = me2;
        }
        else{
            lo = me1;
        }
    }
    std::cout.precision(20);
    std::cout<<ans;
    //printf("%.12lf",(double)ans);
}


#include <stdio.h>
#include <algorithm>
int n;
double a[200010],b[200010],c[200010];
double lo,hi;
double ans = 2e10+1.0;
double min(double a,double b){
    return a<b?a:b;
}
double max(double a,double b){
    return a>b?a:b;
}
double abs(double a){
    return a>0?a:-a;
}
double f(){
    bool minusExist=false,plusExist=false;
    double s1=0,s2=0;
    double ret1=2e10,ret2=-2e10;
    for(int i=1;i<=n;i++){
        if(b[i]<0) minusExist = true;
        if(b[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=b[i];
            if(s1>0) s1 = 0;
            if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=n;i>=1;i--){
            s2+=b[i];
            if(s2<0) s2 = 0;
            if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
double g(){
    bool minusExist=false,plusExist=false;
    double s1=0,s2=0;
    double ret1=2e10,ret2=-2e10;
    for(int i=1;i<=n;i++){
        if(c[i]<0) minusExist = true;
        if(c[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=c[i];
            if(s1>0) s1 = 0;
            if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=n;i>=1;i--){
            s2+=c[i];
            if(s2<0) s2 = 0;
            if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
double h(double x){
    bool minusExist=false,plusExist=false;
    double s1=0,s2=0;
    double ret1=2e10,ret2=-2e10;
    for(int i=1;i<=n;i++){
        a[i]-=x;
    }
    for(int i=1;i<=n;i++){
        if(a[i]<0) minusExist = true;
        if(a[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=a[i];
            if(s1>0) s1 = 0;
            if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=n;i>=1;i--){
            s2+=a[i];
            if(s2<0) s2 = 0;
            if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%lf",&a[i]);
    }
    lo = -10100.0;
    hi = 10100.0;
    while((hi-lo)>1e-10){
        double me1 = lo+(hi-lo)/3.0;
        double me2 = hi-(hi-lo)/3.0;
        for(int i=1;i<=n;i++){
            b[i] = a[i]-me1;
            c[i] = a[i]-me2;
        }
        double res1 = f();
        double res2 = g();
        ans = min(ans,min(res1,res2));
        if(res1<res2){
            hi = me2;
        }
        else{
            lo = me1;
        }
    }
    printf("%.9lf",ans);
}


#include <stdio.h>
#include <iostream>
int n;
int A[200010];
long double a[200010],b[200010],c[200010];
long double lo,hi;
long double ans = 2e10+1.0;
long double min(long double a,long double b){
    return a<b?a:b;
}
long double max(long double a,long double b){
    return a>b?a:b;
}
long double abs(long double a){
    return a>0?a:-a;
}
long double f(){
    bool minusExist=false,plusExist=false;
    long double s1=0,s2=0;
    long double ret1=2e10+1,ret2=-2e10-1;
    for(int i=1;i<=n;i++){
        if(b[i]<0) minusExist = true;
        if(b[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=b[i];
            if(s1>0) s1 = 0;
            else if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=1;i<=n;i++){
            s2+=b[i];
            if(s2<0) s2 = 0;
            else if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
long double g(){
    bool minusExist=false,plusExist=false;
    long double s1=0,s2=0;
    long double ret1=2e10+1,ret2=-2e10-1;
    for(int i=1;i<=n;i++){
        if(c[i]<0) minusExist = true;
        if(c[i]>0) plusExist = true;
    }
    if(minusExist){
        for(int i=1;i<=n;i++){
            s1+=c[i];
            if(s1>0) s1 = 0;
            else if(ret1>s1) ret1 = s1;
        }
    }
    else{
        ret1 = 0;
    }
    if(plusExist){
        for(int i=1;i<=n;i++){
            s2+=c[i];
            if(s2<0) s2 = 0;
            else if(ret2<s2) ret2 = s2;
        }
    }
    else{
        ret2 = 0;
    }
    return max(abs(ret1),abs(ret2));
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++){
        scanf("%d",&A[i]);
        a[i] = A[i];
    }
    lo = -10100.0;
    hi = 10100.0;
    for(int i=1;i<=300;i++){
        long double me1 = lo+(hi-lo)/3.0;
        long double me2 = hi-(hi-lo)/3.0;
        for(int i=1;i<=n;i++){
            b[i] = a[i]+me1;
            c[i] = a[i]+me2;
        }
        long double res1 = f();
        long double res2 = g();
        ans = min(ans,min(res1,res2));
        if(res1<res2){
            hi = me2;
        }
        else{
            lo = me1;
        }
    }
    std::cout.precision(9);
    std::cout<<ans;
    //printf("%.12lf",(double)ans);
}


#include <iostream>
#include <cstdio>
#define ep 1e-11
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l + ep < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#define ep 1e-12
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l + ep < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <map>
#define ep 1e-11
using namespace std;

int a[200010];
int n;
map<double, double> Map;
inline double weakness(double x) {
    if (Map.find(x) != Map.end())
        return Map[x];
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return Map[x] = max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l + ep < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#define ep 1e-10
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l + ep < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#define ep 1e-10
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (r - l >= ep) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 + ep < M2) {
                r = m2;
            }
            else if (M1 > M2 + ep) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.10lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#include <map>
#define ep 1e-12
using namespace std;

int a[200010];
int n;
map<double, double> Map;
inline double weakness(double x) {
    if (Map.find(x) != Map.end())
        return Map[x];
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return Map[x] = max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l + ep < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#define ep 1e-12
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (l < r) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 < M2) {
                r = m2;
            }
            else if (M1 > M2) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.15lf\n", weakness(l));
    }
    return 0;
}


#include <iostream>
#include <cstdio>
#define ep 1e-12
using namespace std;

int a[200010];
int n;
inline double weakness(double x) {
    double m1 = 0;
    double m2 = 0;
    double s1 = 0;
    double s2 = 0;
    for (int i = 0; i < n; i++) {
        if (s1 + a[i] - x >= 0)
            s1 += a[i] - x;
        else
            s1 = 0;
        m1 = max(m1, s1);

        if (s2 + x - a[i] >= 0)
            s2 += x - a[i];
        else
            s2 = 0;
        m2 = max(m2, s2);
    }
    return max(m1, m2);
}
int main() {
    while (cin >> n) {
        int min = 10001;
        int max = -10001;
        for (int i = 0; i < n; i++) {
            cin >> a[i];
            if (a[i] < min)
                min = a[i];
            if (a[i] > max)
                max = a[i];
        }
        double l = min;
        double r = max;
        while (r - l >= ep) {
            double m1 = l + (r - l) / 3;
            double m2 = r - (r - l) / 3;
            double M1 = weakness(m1);
            double M2 = weakness(m2);
            if (M1 + ep < M2) {
                r = m2;
            }
            else if (M1 > M2 + ep) {
                l = m1;
            }
            else {
                l = m1;
                r = m2;
            }
        }
        printf("%.10lf\n", weakness(l));
    }
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-11)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck((l+r)/2));
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-7)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck(l));
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
ll a[N];
double fuck(double x)
{
    int i;
    double s1,s2;
    double ans=0;
    s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r,m;
    cin>>n;
    l=-1e4;r=1e4;
    for(i=0;i<n;i++)scanf("%I64d",a+i);
    while(l<r-1.0)
    {
        double l1=fuck(l+(r-l)/3),r1=fuck(r-(r-l)/3);
        if(l1>r1)l=l+(r-l)/3;
        else r=r-(r-l)/3;
    }
    double j=floor(l)-2.0,ans=fuck(l);
    for(;j<=floor(l)+2.0;j+=0.5)ans=min(ans,fuck(j));
    printf("%.10lf",ans);
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-0.5)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    double j,ans=fuck(l);
    for(j=floor(l)-5.0;j<=floor(l)+5.0;j+=0.5)ans=min(ans,fuck(j));
    printf("%.20lf",ans);
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-9)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck((l+r)/2));
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-8)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck((l+r)/2));
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
ll a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r,m;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%I64d",a+i);
    while(l<r-0.5)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    double j=floor(l)-2.0,ans=fuck(l);
    for(;j<=floor(l)+2.0;j+=0.5)ans=min(ans,fuck(j));
    printf("%.20lf",ans);
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-10)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck((l+r)/2));
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
ll a[N];
double fuck(double x)
{
    int i;
    double s1,s2;
    double ans=0;
    s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r,m;
    cin>>n;
    l=-1e4;r=1e4;
    for(i=0;i<n;i++)scanf("%I64d",a+i);
    while(l<r-1)
    {
        double l1=fuck(l+(r-l)/3),r1=fuck(r-(r-l)/3);
        if(l1>r1)l=l+(r-l)/3;
        else r=r-(r-l)/3;
    }
    double j=floor(l)-1.0,ans=fuck(l);
    for(;j<=floor(l)+1.0;j+=0.5)ans=min(ans,fuck(j));
    printf("%.10lf\n",ans);
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-0.5)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    double j,ans=fuck(l);
    for(j=floor(l)-5.0;j<=floor(l)+5.0;j+=0.01)ans=min(ans,fuck(j));
    printf("%.20lf",ans);
    return 0;
}


#include<cstdio>
#include<algorithm>
#include<iostream>
#include<cstring>
#include<vector>
#include<cmath>
#include<map>
using namespace std;
typedef long long ll;
const int N=2e5+1;
int n;
double a[N];
double fuck(double x)
{
    int i;
    double s1,s2,ans;
    ans=s1=s2=0.0;
    for(i=0;i<n;i++)
    {
        s1+=a[i]-x;
        s2+=a[i]-x;
        s1=max(s1,0.0);
        s2=min(s2,0.0);
        ans=max(ans,s1);
        ans=max(ans,fabs(s2));
    }
    return ans;
}
int main()
{
    int i;
    double l,r;
    cin>>n;
    l=-2e4;r=2e4;
    for(i=0;i<n;i++)scanf("%lf",a+i);
    while(l<r-1e-6)
    {
        double l1=fuck(l+(r-l)/3.0),r1=fuck(r-(r-l)/3.0);
        if(l1>r1)l=l+(r-l)/3.0;
        else r=r-(r-l)/3.0;
    }
    printf("%.20lf",fuck(l));
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        temp+=aa[i];
        if(temp<0)
        temp=0;
        ans=max(ans,temp);
        temp1+=aaa[i];
        if(temp1<0)
        temp1=0;
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        while(high-low>=1e-12)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        temp+=aa[i];
        if(temp<0)
        temp=0;
        ans=max(ans,temp);
        temp1+=aaa[i];
        if(temp1<0)
        temp1=0;
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        temp+=aa[i];
        if(temp<0)
        temp=0;
        ans=max(ans,temp);
        temp1+=aaa[i];
        if(temp1<0)
        temp1=0;
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        while(high-low>=1e-11)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        if(aa[i]>0)
        temp+=aa[i];
        else temp=max(0.0,temp+aa[i]);
        ans=max(ans,temp);
        if(aaa[i]>0)
        temp1+=aaa[i];
        else temp1=max(0.0,temp1+aaa[i]);
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=low+(high-low)/3.0;
            midd=high-(high-low)/3.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        if(aa[i]>0)
        temp+=aa[i];
        else temp=max(0.0,temp+aa[i]);
        ans=max(ans,temp);
        if(aaa[i]>0)
        temp1+=aaa[i];
        else temp1=max(0.0,temp1+aaa[i]);
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        double low=10000,high=-10000;
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i],low=min(low,a[i]),high=max(high,a[i]);
        double mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=(high+low)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        if(aa[i]>0)
        temp+=aa[i];
        else temp=max(0.0,temp+aa[i])
        ans=max(ans,temp);
        if(aaa[i]>0)
        temp1+=aaa[i];
        else temp1=max(0.0,temp1+aaa[i]);
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        if(aa[i]>0)
        temp+=aa[i];
        else temp=max(0.0,temp+aa[i]);
        ans=max(ans,temp);
        if(aaa[i]>0)
        temp1+=aaa[i];
        else temp1=max(0.0,temp1+aaa[i]);
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        temp+=aa[i];
        if(temp<0)
        temp=0;
        ans=max(ans,temp);
        temp1+=aaa[i];
        if(temp1<0)
        temp1=0;
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        while(high-low>=1e-10)
        {
            mid=(low+high)/2.0;
            midd=(mid+high)/2.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include<bits/stdc++.h>
using namespace std;
double a[200005];
double aa[200005];
double aaa[200005];
double last=0;
double cal(double x,int n)
{
    for(int i=1;i<=n;++i)
        aa[i]=a[i]-x,aaa[i]=-aa[i];
    double temp=0,temp1=0;
    double ans=0;
    for(int i=1;i<=n;++i)
    {
        if(aa[i]>0)
        temp+=aa[i];
        else temp=max(0.0,temp+aa[i]);
        ans=max(ans,temp);
        if(aaa[i]>0)
        temp1+=aaa[i];
        else temp1=max(0.0,temp1+aaa[i]);
        ans=max(ans,temp1);
    }
    if(last<0)
        last=ans;
    else last=min(last,ans);
    return ans;

}
int main()
{
    int n;
    while(cin>>n)
    {
        last=-1;
        for(int i=1;i<=n;++i)
            cin>>a[i];
        double low=-10000,high=10000,mid,midd;
        int cnt=100;
        while(cnt--)
        {
            mid=low+(low+high)/3.0;
            midd=right-(low+high)/3.0;
            if(cal(mid,n)<=cal(midd,n))
                high=midd;
            else low=mid;
        }
        printf("%.10f\n",last);
    }
}


#include <bits/stdc++.h>
using namespace std;
const int maxn = 2*(int) 1e5 + 5;
const double eps = 1e-9;
int n;
int a[maxn];
double b[maxn];
double s[maxn];
double cal(double x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    double nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    double inf = -1e5, sup = 1e5, p1, p2;
  while (sup - inf >= eps) {
        p1 = (2*inf + sup)/3;
        p2 = (inf + 2*sup)/3;
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    printf("%.6lf", cal(p1));
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-12;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    int A = 11, B = 10;
    for(int i = 0; i < 200; ++i) {
        p1 = (A*inf + B*sup)/(A + B);
        p2 = (B*inf + A*sup)/(A + B);
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-9;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e5, sup = 1e5, p1, p2;
    while (abs(sup - inf) > eps) {
        p1 = (2*inf + sup)/3;
        p2 = (inf + 2*sup)/3;
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-12;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e4, sup = 1e4, p1, p2;
    int A = 2, B = 1;
    for(int i = 0; i < 200; ++i) {
        p1 = (A*inf + B*sup)/(A + B);
        p2 = (B*inf + A*sup)/(A + B);
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-10;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    while (abs(sup - inf) > eps) {
        p1 = (2*inf + sup)/3;
        p2 = (inf + 2*sup)/3;
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-9;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    while (abs(sup - inf) > eps) {
        p1 = (2*inf + sup)/3;
        p2 = (inf + 2*sup)/3;
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-12;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    int A = 11, B = 10;
    while (abs(sup - inf) > eps) {
        p1 = (A*inf + B*sup)/(A + B);
        p2 = (B*inf + A*sup)/(A + B);
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-10;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    int A = 11, B = 10;
    while (abs(sup - inf) > eps) {
        p1 = (A*inf + B*sup)/(A + B);
        p2 = (B*inf + A*sup)/(A + B);
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-12;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e4, sup = 1e4, p1, p2;
    int A = 11, B = 10;
    for(int i = 0; i < 200; ++i) {
        p1 = (A*inf + B*sup)/(A + B);
        p2 = (B*inf + A*sup)/(A + B);
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <bits/stdc++.h>
using namespace std;
typedef double ldb;
const int maxn = 2*(int) 1e5 + 5;
const ldb eps = 1e-15;
int n;
int a[maxn];
ldb b[maxn];
ldb s[maxn];
ldb cal(ldb x) {
    b[0] = 0;
    for(int i = 1; i <= n; ++i) {
        b[i] = b[i-1] + a[i] - x;
        //cout << a[i] - x << endl;
    }
    ldb nmin = 0, nmax = 0, res = 0;
    for(int i = 1; i <= n; ++i) {
        //cout << b[i] - nmin << " " << b[i] - nmax << endl;
        res = max(res, max(abs(b[i] - nmin), abs(b[i] - nmax)));
        nmin = min(nmin, b[i]);
        nmax = max(nmax, b[i]);

    }
    return res;
}

int main() {
    cin >> n;
    for(int i = 1; i <= n; ++i)
        scanf("%d", a + i);
    //cout << cal(2.5) << endl;
    ldb inf = -1e15, sup = 1e15, p1, p2;
    while (abs(sup - inf) > eps) {
        p1 = (2*inf + sup)/3;
        p2 = (inf + 2*sup)/3;
        if (cal(p1) > cal(p2))
            inf = p1;
        else sup = p2;
    }
    //cout << p1 << endl;
    ldb result = min(cal(p1), cal(p2));
    //cout << result << endl;
    printf("%.12lf", result);
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task "findx"

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
const ld eps = 1e-10;
int n;
int a[N];
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0, sum = 0.0;
    for (int i = 1; i <= n; i++)
    {
        sum += ld(a[i]) - x;
        if (sum - mn - res > eps) res = sum - mn;
        if (abs(sum - mx) - res > eps) res = abs(sum - mx);
        if (mn - sum > eps) mn = sum;
        if (sum - mx > eps) mx = sum;
    }
    return res;
}

bool compare(const ld x, const ld y) { return x - y > eps; }

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        freopen(Task".inp", "r",  stdin);
        freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        //cout << fixed << setprecision(6) << double(Lef + Rig) / 2.0 << "\n";
        cout << fixed << setprecision(6) << 0.0 << "\n";
        return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << double(Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-7;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        cout << fixed << setprecision(6) << 0.0 << "\n";; return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
const ld eps = 1e-12;
int n;
int a[N];
ld delta = oo;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0, sum = 0.0;
    for (int i = 1; i <= n; i++)
    {
        sum += ld(a[i]) - x;
        if (sum - mn - res > eps) res = sum - mn;
        if (abs(sum - mx) - res > eps) res = abs(sum - mx);
        if (mn - sum > eps) mn = sum;
        if (sum - mx > eps) mx = sum;
    }
    return res;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    //--------------------------------------------------------------------------------------------------------
    int xx = rand() % int(Rig - Lef + 1);
    ld x = ld(xx);
    //cout << fixed << setprecision(6) << x << "\n";
    while (delta > eps)
    {
        ld f1 = f(x), f2 = f(x + delta), f3 = f(x - delta);
        if (ans - min(f1, min(f2, f3)) > eps) ans = min(f1, min(f2, f3));
        if (f1 - f2 > eps) x = x + delta;
        if (f1 - f3 > eps) x = x - delta;
        delta /= 2;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-7;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-14;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        cout << fixed << setprecision(6) << 0.0 << "\n";; return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-12;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        cout << fixed << setprecision(6) << 0.0 << "\n";; return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-12;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        cout << fixed << setprecision(6) << 0.0 << "\n";; return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    //cout << fixed << setprecision(6) << ans << "\n";
    cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task "findx"

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
const ld eps = 1e-12;
int n;
int a[N];
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0, sum = 0.0;
    for (int i = 1; i <= n; i++)
    {
        sum += ld(a[i]) - x;
        if (sum - mn - res > eps) res = sum - mn;
        if (abs(sum - mx) - res > eps) res = abs(sum - mx);
        if (mn - sum > eps) mn = sum;
        if (sum - mx > eps) mx = sum;
    }
    return res;
}

bool compare(const ld x, const ld y) { return x - y > eps; }

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        freopen(Task".inp", "r",  stdin);
        freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;

    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    if (Lef == Rig)
    {
        //cout << fixed << setprecision(6) << double(Lef + Rig) / 2.0 << "\n";
        cout << fixed << setprecision(6) << 0.0 << "\n";
        return 0;
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << double(Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1 * 1000 * 1000 + 2604;
const ld eps = 1e-12;
int n;
int a[N];
ld delta = oo;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0, sum = 0.0;
    for (int i = 1; i <= n; i++)
    {
        sum += ld(a[i]) - x;
        if (sum - mn - res > eps) res = sum - mn;
        if (abs(sum - mx) - res > eps) res = abs(sum - mx);
        if (mn - sum > eps) mn = sum;
        if (sum - mx > eps) mx = sum;
    }
    return res;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    //--------------------------------------------------------------------------------------------------------
    int xx = rand() % int(Rig - Lef + 1);
    ld x = ld(xx);
    while (delta > eps)
    {
        ld f1 = f(x), f2 = f(x + delta), f3 = f(x - delta);
        if (ans - min(f1, min(f2, f3)) > eps) ans = min(f1, min(f2, f3));
        if (f1 - f2 > eps) x = x + delta;
        if (f1 - f3 > eps) x = x - delta;
        delta /= 2;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include <iomanip>
#include <cstring>
#include <set>
#include <map>
#include <algorithm>
#include <queue>
#include <vector>
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <time.h>
#include <fstream>
#include <stdlib.h>
#include <list>
#include <stack>
#include <string>
#include <string.h>
using namespace std;
#define LightKuriboh
#define X first
#define Y second
#define pb push_back
#define pf pop_front
#define mp make_pair
#define CL(x) x << 1
#define CR(x) (x << 1) + 1
#define Task ""

const bool OnLineJudge = 1;

typedef long long cc;
typedef long double ld;
typedef pair <int, int> pt;
const int N = 200005;
const ld oo = 1000 * 1000 * 1000 + 2604;
int n;
int a[N];
ld b[N];
ld sum[N];
const ld eps = 1e-7;
ld ans = oo;
ld Lef = oo, Rig = -oo;

ld f(const ld x)
{
    for (int i = 1; i <= n; i++) b[i] = ld(a[i]) - x;
    for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] + b[i];
    ld mx = 0.0, mn = 0.0;
    ld res = 0.0;
    for (int i = 1; i <= n; i++)
    {
        if (sum[i] - mn - res > eps) res = sum[i] - mn;
        //res = max(res, sum[i] - mn);
        if (abs(sum[i] - mx) - res > eps) res = abs(sum[i] - mx);
        //res = max(res, abs(sum[i] - mx));
        if (mn - sum[i] > eps) mn = sum[i];
        //mn = min(mn, sum[i]);
        if (sum[i] - mx > eps) mx = sum[i];
        //mx = max(mx, sum[i]);
    }
    return res;
}

bool compare(const ld x, const ld y)
{
    return x - y > eps;
}

int main()
{
    if (!OnLineJudge)
    {
        freopen("input.inp", "r", stdin);
        //freopen("out1.out", "w", stdout);
        //freopen(Task".inp", "r",  stdin);
        //freopen(Task".out", "w", stdout);
    }
    std :: ios_base :: sync_with_stdio(false); cin.tie(0);
    //--------------------------------------------------------------------------------------------------------
    cin >> n;
    if (n == 1)
    {
        cout << fixed << setprecision(6) << 0.0 << "\n";; return 0;
    }
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        Lef = min(Lef, ld(a[i]));
        Rig = max(Rig, ld(a[i]));
    }
    //--------------------------------------------------------------------------------------------------------
    ld MidLef, MidRig;
    while (Rig - Lef > eps)
    {
        MidLef = (Lef + Lef + Rig) / 3.0;
        MidRig = (Lef + Rig + Rig) / 3.0;
        ld fml = f(MidLef), fmr = f(MidRig);
        if (ans - min(fml, fmr) > eps) ans = min(fml, fmr);
        if (compare(fml, fmr)) Lef = MidLef; else Rig = MidRig;
    }
    //--------------------------------------------------------------------------------------------------------
    cout << fixed << setprecision(6) << ans << "\n";
    //cout << fixed << setprecision(6) << (Lef + Rig) / 2.0 << "\n";
    //--------------------------------------------------------------------------------------------------------
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=1e18,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    printf("%lld.",ans/10000000);
    d=ans%10000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=7-cnt;i++) printf("0"); printf("%d",ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
        a[i]=-a[i];
        a[i]+=x;
    }
    return dap;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<pro(mid+1)) en=mid;
        else st=mid+1;
    }
    ans=pro(st);
    ans=min(ans,pro(st-1));
    ans=min(ans,pro(st+1));
    printf("%lld.",ans/10000000);
    d=ans%10000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=7-cnt;i++) printf("0"); printf("%d",ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int n;
long long ans,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
        a[i]=-a[i];
        a[i]+=x;
    }
    return dap;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<pro(mid+1)) en=mid;
        else st=mid+1;
    }
    ans=pro(st);
    ans=min(ans,pro(st-1));
    ans=min(ans,pro(st+1));
    printf("%lld.%lld",ans/10000000,ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int n;
long long st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
        a[i]=-a[i];
        a[i]+=x;
    }
    return dap;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en)
    {
        mid=(st+en)/2;
        if(pro(mid)<pro(mid+1)) en=mid;
        else st=mid+1;
    }
    st=pro(st);
    printf("%lld.%lld",st/10000000,st%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    return dap;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<pro(mid+1)) en=mid;
        else st=mid+1;
    }
    ans=pro(st);
    ans=min(ans,pro(st-1));
    ans=min(ans,pro(st+1));
    printf("%lld.",ans/10000000);
    d=ans%10000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=7-cnt;i++) printf("0"); printf("%d",ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=2e18,st=-1e14,en=1e14,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%lld.",ans/10000000000);
    d=ans%10000000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=9-cnt;i++) printf("0"); printf("%lld",ans%10000000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=1e18,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=1e9;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%lld.",ans/1000000000);
    d=ans%100000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=9-cnt;i++) printf("0"); printf("%lld",ans%100000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=1e18,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%lld.",ans/10000000);
    d=ans%10000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=7-cnt;i++) printf("0"); printf("%d",ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=1e18,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=1e9;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%lld.",ans/1000000000);
    d=ans%1000000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=9-cnt;i++) printf("0"); printf("%lld",ans%1000000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans=2e18,st=-1e14,en=1e14,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%lld.",ans/10000000000);
    d=ans%10000000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=10-cnt;i++) printf("0"); printf("%lld",ans%10000000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
long long d,ans,st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=0;
    ans=max(ans,dap);
    ans=max(ans,dap2);
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<0) en=mid;
        else st=mid+1;
    }
    printf("%lld.",ans/10000000);
    d=ans%10000000;
    while(d)
    {
        d/=10; cnt++;
    }
    for(i=1;i<=7-cnt;i++) printf("0"); printf("%d",ans%10000000);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt,n;
double d,st=-10001,en=10001,a[200010],mid,ans=1e18;
double pro(double x)
{
    int i;
    double sum2=0,dap=0,dap2=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap=max(dap,sum2);
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        if(sum2<0) sum2=0;
        dap2=max(dap2,sum2);
        a[i]=-a[i];
        a[i]+=x;
    }
    ans=min(ans,max(dap,dap2));
    return dap-dap2;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++) scanf("%lf",&a[i]);
    while(cnt<=100)
    {
        cnt++;
        mid=(st+en)/(double)2;
        if(pro(mid)<0) en=mid;
        else st=mid;
    }
    pro(st+1); pro(st-1); pro(st);
    printf("%.10lf",ans);
    return 0;
}


#include<stdio.h>
#include<algorithm>
using namespace std;
int n;
long long st=-1e13,en=1e13,a[200010],mid;
long long pro(long long x)
{
    int i;
    long long sum2=0,dap=0;
    for(i=1;i<=n;i++)
    {
        a[i]-=x;
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
    }
    sum2=0;
    for(i=1;i<=n;i++)
    {
        a[i]=-a[i];
        sum2+=a[i];
        dap=max(dap,sum2);
        if(sum2<0) sum2=0;
        a[i]=-a[i];
        a[i]+=x;
    }
    return dap;
}
int main()
{
    int i;
    scanf("%d",&n);
    for(i=1;i<=n;i++){scanf("%lld",&a[i]); a[i]*=10000000;}
    while(st!=en && en!=st+1)
    {
        mid=(st+en)/2;
        if(pro(mid)<pro(mid+1)) en=mid;
        else st=mid+1;
    }
    st=pro(st);
    printf("%lld.%lld",st/10000000,st%10000000);
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	n = 20001;
	a[1] = -10000;
	for (int i = 2; i <= n; ++i)
		a[i] = a[i - 1] + 1;

	double tmp = 0;
	for (int i = 1; i <= n; ++i)
		tmp += (double)a[i] / n;
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	double minSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, sum[i] - minSum);
		minSum = min(minSum, sum[i]);
	}
	cout << fixed << setprecision(10) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;
const double eps = 1e-11;

int n, a[MAXN];

double f(double M) {
	double sum, sumMin, sumMax;
	sum = sumMin = sumMax = 0.0;

	double res = 0;
	for (int i = 1; i <= n; ++i) {
		sum += (double)a[i] - M;
		res = max(res, fabs(sum - sumMin));
		res = max(res, fabs(sum - sumMax));
		// cout <<i <<" "<<sum << endl;
		sumMin = min(sumMin, sum);
		sumMax = max(sumMax, sum);
	}
	return res;
}

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	n = 200000;
	a[1] = -10000;
	for (int i = 2; i <= n; ++i)
		a[i] = a[i - 1] + 1;
	a[n] = -10000;

	double L = -10001, R = 10001;
	while (fabs(R - L) > eps) {
		double M1 = L + (R - L) / 3, M2 = R - (R - L) / 3;
		if (f(M1) < f(M2))
			R = M2;
		else
			L = M1;
	}

	// cout << f(2) << endl;
	// cout << L << " "<<R <<" "<<(L + R) / 2<< endl;
	cout << fixed << setprecision(7) << f((L + R) / 2);
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	// n = 200000;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;
	// a[n] = -10000;

	int maxVal = a[1], minVal = a[1];
	for (int i = 2; i <= n; ++i)
		maxVal = max(maxVal, a[i]), minVal = min(minVal, a[i]);

	double tmp = (maxVal + minVal) / 2 + 0.5 * ((maxVal + minVal) % 2);
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;//, cout << x[i] << endl;

	sum[0] = 0.0;
	double minSum = 0.0;
	double maxSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, fabs(sum[i] - minSum));
		res = max(res, fabs(sum[i] - maxSum));
		minSum = min(minSum, sum[i]);
		maxSum = max(maxSum, sum[i]);
	}
	cout << fixed << setprecision(15) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;
const double eps = 1e-11;

int n, a[MAXN];

double f(double M) {
	double sum, sumMin, sumMax;
	sum = sumMin = sumMax = 0.0;

	double res = 0;
	for (int i = 1; i <= n; ++i) {
		sum += (double)a[i] - M;
		res = max(res, fabs(sum - sumMin));
		res = max(res, fabs(sum - sumMax));
		// cout <<i <<" "<<sum << endl;
		sumMin = min(sumMin, sum);
		sumMax = max(sumMax, sum);
	}
	return res;
}

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	// n = 200000;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;
	// a[n] = -10000;

	double L = -10001, R = 10001;
	while (fabs(R - L) > eps) {
		double M1 = L + (R - L) / 3, M2 = R - (R - L) / 3;
		if (f(M1) < f(M2))
			R = M2;
		else
			L = M1;
	}

	// cout << f(2) << endl;
	// cout << L << " "<<R <<" "<<(L + R) / 2<< endl;
	cout << fixed << setprecision(7) << f((L + R) / 2);
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	// n = 20001;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;

	double tmp = 0;
	for (int i = 1; i <= n; ++i)
		tmp += (double)a[i] / n;
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	double minSum = 0.0;
	double maxSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, fabs(sum[i] - minSum));
		res = max(res, fabs(sum[i] - maxSum));
		minSum = min(minSum, sum[i]);
		maxSum = max(maxSum, sum[i]);
	}
	cout << fixed << setprecision(10) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	// n = 20001;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;
	// a[n] = -10000;

	double maxVal = a[1], minVal = a[1];
	for (int i = 2; i <= n; ++i)
		maxVal = max(maxVal, (double)a[i]), minVal = min(minVal, (double)a[i]);

	double tmp = (maxVal + minVal) / 2;
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	double minSum = 0.0;
	double maxSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, fabs(sum[i] - minSum));
		res = max(res, fabs(sum[i] - maxSum));
		minSum = min(minSum, sum[i]);
		maxSum = max(maxSum, sum[i]);
	}
	cout << fixed << setprecision(10) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	// n = 200000;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;
	// a[n] = -10000;

	int maxVal = a[1], minVal = a[1];
	for (int i = 2; i <= n; ++i)
		maxVal = max(maxVal, a[i]), minVal = min(minVal, a[i]);

	double tmp = (maxVal + minVal) / 2 + 0.5 * ((maxVal + minVal) % 2);
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;//, cout << x[i] << endl;

	sum[0] = 0.0;
	double minSum = 0.0;
	double maxSum = 0.0;
	double res1 = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res1 = max(res1, fabs(sum[i] - minSum));
		res1 = max(res1, fabs(sum[i] - maxSum));
		minSum = min(minSum, sum[i]);
		maxSum = max(maxSum, sum[i]);
	}

	tmp = 0;
	for (int i = 1; i <= n; ++i)
		tmp += (double)a[i] / n;
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	minSum = 0.0;
	maxSum = 0.0;
	double res2 = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res2 = max(res2, fabs(sum[i] - minSum));
		res2 = max(res2, fabs(sum[i] - maxSum));
		minSum = min(minSum, sum[i]);
		maxSum = max(maxSum, sum[i]);
	}
	cout << fixed << setprecision(10) << min(res1, res2);

}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];
	// n = 20001;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;

	double tmp = 0;
	for (int i = 1; i <= n; ++i)
		tmp += (double)a[i] / n;
	// tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	double minSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, sum[i] - minSum);
		minSum = min(minSum, sum[i]);
	}
	cout << fixed << setprecision(10) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;

int n, a[MAXN];

double x[MAXN], sum[MAXN];

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	double tmp = 0;
	for (int i = 1; i <= n; ++i)
		tmp += a[i];
	tmp /= n;

	for (int i = 1; i <= n; ++i)
		x[i] = a[i] - tmp;

	sum[0] = 0.0;
	double minSum = 0.0;
	double res = -1e12;
	for (int i = 1; i <= n; ++i) {
		sum[i] = sum[i - 1] + x[i];
		res = max(res, sum[i] - minSum);
		minSum = min(minSum, sum[i]);
	}
	cout << fixed << setprecision(10) << res;
}


#include <bits/stdc++.h>

using namespace std;

const int MAXN = 2E5 + 5;
const double eps = 1e-7;

int n, a[MAXN];

double f(double M) {
	double sum, sumMin, sumMax;
	sum = sumMin = sumMax = 0.0;

	double res = 0;
	for (int i = 1; i <= n; ++i) {
		sum += (double)a[i] - M;
		res = max(res, fabs(sum - sumMin));
		res = max(res, fabs(sum - sumMax));
		// cout <<i <<" "<<sum << endl;
		sumMin = min(sumMin, sum);
		sumMax = max(sumMax, sum);
	}
	return res;
}

int main() {
	// freopen("input.txt", "r", stdin);
	ios_base::sync_with_stdio(0);

	cin >> n;
	for (int i = 1; i <= n; ++i)
		cin >> a[i];

	// n = 200000;
	// a[1] = -10000;
	// for (int i = 2; i <= n; ++i)
	// 	a[i] = a[i - 1] + 1;
	// a[n] = -10000;

	double L = -10001, R = 10001;
	while (fabs(R - L) > eps) {
		double M1 = L + (R - L) / 3, M2 = R - (R - L) / 3;
		if (f(M1) < f(M2))
			R = M2;
		else
			L = M1;
	}

	// cout << f(2) << endl;
	// cout << L << " "<<R <<" "<<(L + R) / 2<< endl;
	cout << fixed << setprecision(7) << f((L + R) / 2);
}


#undef NDEBUG
#ifdef SU1
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int i = int(l); i < int(r); i++)
#define correct(x, y, n, m) (0 <= (x) && (x) < (n) && 0 <= (y) && (y) < (m))
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define x first
#define y second

using namespace std;

typedef long long li;
typedef float ld;
typedef pair<int, int> pt;

template<typename X> inline X abs(const X& a) { return a < 0? -a: a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-11, PI = 3.1415926535897932384626433832795;

const int N = 200200;

int n, a[N];

inline bool read() {
	if (!(cin >> n)) return false;
	forn(i, n) assert(scanf("%d", &a[i]) == 1);
	return true;
}

li s[N];

inline void solve() {
	forn(i, n) s[i + 1] = s[i] + a[i];
	//cerr << s[n - 1] << ' ' << s[n] << endl;

	const int C1 = 44;
	const ld M1 = 1e7;
	const int C2 = C1;
	const ld M2 = M1;

	ld lf = 0, rg = M1;
	forn(i, C1) {
		ld delta = (lf + rg) / 2;

		//delta = 0;

		ld ll = -M2, rr = M2;
		forn(j, C2) {
			ld epsilon = (ll + rr) / 2;

			//epsilon = 2;

			ld minv = 0;
			int good = 0;
			fore(k, 1, n + 1) {
				ld cur = s[k] - epsilon * k;
				if (cur - minv + EPS >= delta) {
					//cerr << "k=" << k << " cur=" << cur << " maxv=" << maxv << endl;
					good = 1;
					break;
				}
				minv = min(minv, cur);
			}
			//cerr << "bad=" << bad << endl;
			//exit(0);

			if (good) ll = epsilon;
			else rr = epsilon;
		}
		ld x1 = ll;

		//cerr << "x1=" << x1 << endl;
		//exit(0);

		ll = -M2, rr = M2;
		forn(j, C2) {
			ld epsilon = (ll + rr) / 2;
			ld maxv = 0;
			int good = 0;
			fore(k, 1, n + 1) {
				ld cur = s[k] - epsilon * k;
				if (cur - maxv <= -delta + EPS) {
					good = 1;
					break;
				}
				maxv = max(maxv, cur);
			}
			if (good) rr = epsilon;
			else ll = epsilon;
		}
		ld x2 = rr;
		//cerr << "x1=" << x1 << " x2=" << x2 << endl;
		if (x1 <= x2 + EPS) rg = delta;
		else lf = delta;
	}
	cout << rg << endl;
}

int main() {
#ifdef SU1
    assert(freopen("input.txt", "rt", stdin));
    assert(freopen("output.txt", "wt", stdout));
#endif

    cout << setprecision(10) << fixed;
    cerr << setprecision(5) << fixed;

    while (read()) {
		solve();
		//break;
	}

    return 0;
}