N = int(input())
v = list(map(int, input().split()))
if len(v) == 2:
    print((v[0] + v[1])/2)
    exit()
cal_lis = []
result = []
new_max = 0
old_max = 0
for i in range(1,len(v)):
    cal_lis = v.copy()
    calc = (v[i] + v[i-1])/2
    cal_lis.remove(v[i])
    cal_lis.remove(v[i-1])
    for j in range(len(cal_lis)):
        new_max = (calc + cal_lis[j])/2
        if old_max < new_max:
            old_max = new_max
            result.append(new_max)
        calc = new_max
print(max(result))
