#include<bits/stdc++.h>
using namespace std;

#define LL long long

int main(){
    double n;
    cin>>n;
    vector<double>v(n);
    for(int i=0;i<n;i++){
        cin>>v[i];
    }
    set<double,greater<>>res;
    cout<<fixed<<setprecision(5);
    double s=1;
    double ss=1;
    s=v[0];
    ss=v[n-1];
    for(int j=1;j<n;j++){
        s=(s+v[j])/2.0;
    }
    for(int j=n-2;j>=0;j--){
        ss=(ss+v[j])/2.0;
    }
    res.insert(s);
    res.insert(ss);
    for(double x : res){
        cout<<x<<endl;
        break;
    }
    return 0;
}
