You have a pot and N ingredients. Each ingredient has a real number parameter called value, and the value of the i-th ingredient (1 \leq i \leq N) is v_i.
When you put two ingredients in the pot, they will vanish and result in the formation of a new ingredient. The value of the new ingredient will be (x + y) / 2 where x and y are the values of the ingredients consumed, and you can put this ingredient again in the pot.
After you compose ingredients in this way N-1 times, you will end up with one ingredient. Find the maximum possible value of this ingredient.

-----Constraints-----
 - 2 \leq N \leq 50
 - 1 \leq v_i \leq 1000
 - All values in input are integers.

-----Input-----
Input is given from Standard Input in the following format:
N
v_1 v_2 \ldots v_N

-----Output-----
Print a decimal number (or an integer) representing the maximum possible value of the last ingredient remaining.
Your output will be judged correct when its absolute or relative error from the judge's output is at most 10^{-5}.

-----Sample Input-----
2
3 4

-----Sample Output-----
3.5

If you start with two ingredients, the only choice is to put both of them in the pot. The value of the ingredient resulting from the ingredients of values 3 and 4 is (3 + 4) / 2 = 3.5.
Printing 3.50001, 3.49999, and so on will also be accepted.

Difficulty: introductory

Starter code:

Solutions:
N = int(input())
v = sorted(map(int, input().split()))

tmp = v[0]
for i in range(1,N):
  tmp = (tmp+v[i])/2.0
  
print(tmp)

N = int(input())
v = [int(x) for x in input().split()]
v.sort()
ans = (v[0]+v[1])/2.0
for i in range(2, N):
  ans = float(ans+v[i])/2
print(ans)

n=int(input())
v =list(map(int,input().split()))
v.sort()
x = v[0]
if n > 2:
        for i in range(1,n):
            x += v[i]*2**(i-1)

        ans = x/2**(n-1)
        print(ans)

else:
        print((x+v[1])/2)

N = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse = False)
for i in range(N-1):
    a[i+1] = (a[i] + a[i+1]) / 2

print((a[N-1]))


N = int(input())
V = list(map(int, input().split()))
V.sort()

for i in range(N-1):
    V[i + 1] = (V[i] + V[i + 1])/2

print((V[N-1]))


N = int(input())
S = list(map(int,input().split()))
S = sorted(S)
a = S[0]
for i in range(N-1):
  a = (a + S[i+1])/2
  
print(a)

# -*- coding: utf-8 -*-
"""
Created on Wed Sep  9 21:55:15 2020

@author: liang
"""

N = int(input())
V = list(map(int,input().split()))
V.sort(reverse=True)
#print(V)
for i in range(N-1):
    tmp = 0
    tmp += (V.pop() + V.pop())/2
    V.append(tmp)

print(V[0])

n = int(input())

s = list(map(int, input().split()))

s.sort()

v = 0

if n == 1:
  print(s[0])
  return
elif n == 2:
  print((s[0]+s[1])/2)
  return

c = (s[0]+s[1])/2

del s[0]
del s[0]

for i in range(n-2):
  c = (c + s[0])/2
  del s[0]
  
  
print(c)

n=int(input())
v=sorted(list(map(lambda x:int(x),input().split())))

ans=(v[0]+v[1])/2
for i in range(2,n):
  ans=(ans+v[i])/2
  
print(ans)

M = int(input())
A = list(map(int,input().split()))
A.sort()
count = 0
count = (A[0]+A[1])/2
for i in range(2,M):
  count = (count+A[i])/2
  
print(count)


N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
    for i in ls[1:]:
        val = (val + i) / 2
print(val)

N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
    for i in ls[1:]:
        val = (val + i) / 2
print(val)

N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
if N == 2:
  print(sum(A)/2)
  return
else:
  temp = (A[0]+A[1])/2
  for i in range(2, N):
    temp = 1/2*(A[i] + temp)
print(temp)

n = int(input())
v = list(map(int,input().split()))
v = sorted(v)
count = v[0]
for i in range(1,n):
    count = (count + v[i])/2
print(count)

N = int(input())
v = list(map(int, input().split()))

vs = sorted(v)
alc = 0
for i in range(N):
    if alc == 0:
        alc = vs[0]
    else:
        alc = (alc+vs[i])/2
print(alc)

n = int(input())
v = [int(s) for s in input().split()]
v.sort()
avg = v[0]

for i in range(1, n):
    avg = avg / 2 + v[i] / 2
print(avg)

N=int(input())
v=list(map(int,input().split()))
v.sort()
x=(v[0]+v[1])/2
for i in range(2,N):
    x=(x+v[i])/2
print(x)


N = int(input())
v = sorted([int(i) for i in input().split()])
for i in range(N-1):
    a = v.pop(0)
    b = v.pop(0)
    v.append((a+b)/2)
    v.sort()
print(v[0])

N = int(input())
V = sorted(list(map(int, input().split())))

ans = V[0]

for v in V:
    ans = (ans + v)/2

print(ans)

N=int(input())
v=list(map(int,input().split()))

v.sort()
ans=(v[0]+v[1])/2

for i in range(2,N):
    ans=ans+v[i]
    ans/=2

print(ans)

N = int(input())
v = list(map(int, input().split()))
v.sort()
ans = v[0]

for i in range(N-1):
    ans = (ans+v[i+1]) / 2

# if str(ans)[-2:] == '.0':
#     print(str(ans).rstrip('.0'))
# else:
#     print(ans)

print(ans)

n=int(input())
v=list(map(int,input().split()))

for i in range(n-1):
  v.sort()
  v.append((v[0]+v[1])/2)
  v.pop(0)
  v.pop(0)
  
print(v[0])

n = int(input())
v = list(map(int, input().split()))
v_s = sorted(v)
m = v_s[0]
for i in range(n-1):
  m  = (m + v_s[i+1]) / 2
print(m)

def resolve():
    n = int(input())
    v = list(map(int,input().split()))
    v.sort(reverse=True)
    for _ in range(n-1):
        v = v[:-2]+ [(v[-1]+v[-2])/2]
    print(v[0])
resolve()

#ABC138 C

N = int(input())
V = list(map(int,input().split()))
V.sort()
K = V[0]
for i in range(1,N):
    K = (K+V[i])/2
    
print(K)

n = int(input())
vn = sorted(list(map(int, input().split())))
ans = vn[0]
for i in range(1, n):
    ans = (ans + vn[i]) / 2
print(ans)


N=int(input())
x = list(map(int, input().split()))
x.sort()
ans=x[0]
for i in range(N-1):
    ans=(ans+x[i+1])/2
print(ans)

n = int(input())
v = sorted(list(map(int, input().split())), reverse=True)

ans = 0
t = 1
for i in range(n-1):
    t *= 2
    ans += v[i] / t
print(ans + v[-1]/t)

N = int(input())
V = sorted(list(map(int,input().split())))
ans = (V[0]+V[1])/2

for n in range(2,N):
  ans = (ans+V[n])/2
  
print(ans)

n = int(input())
guzai = list(map(int,input().split()))

guzai.sort()

ave =(guzai[0] + guzai[1])/2

for x in range(2,n):
  ave = (ave + guzai[x])/2
  
print(ave)


N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
    for i in ls[1:]:
        val = (val + i) / 2
print(val)

n = int(input())
v = list(map(int, input().split()))

v.sort()

ans = v[0]
for i in range(1, n):
    ans = (ans + v[i])/2

print(ans)

n = int(input())
v = sorted(list(map(int,input().split())))
s = [0]*n
s[0] = v[0]

for i in range(n-1):
    s[i+1] = (v[i+1]+s[i])/2
print((s[-1]))


N = int(input())
V = list(map(int, input().split()))
while len(V) > 1:
	V = sorted(V)
	temp = (V.pop(0) + V.pop(0)) / 2
	V.append(temp)
	
print(V[0])

n = int(input())
v = [int(x.strip()) for x in input().split()]
vs = sorted(v)
ans = 0
for i in range(n):
  a = (vs[i]/(2**(n-max(i,1))))
  ans += a
print(ans)

n=int(input())
v=list(map(int,input().split()))
while len(v) != 1:
  v.sort()
  v[0] = (v[0]+v[1])/2
  v.pop(1)
print(v[0])

n = int(input())
a = list(map(int,input().split()))
a.sort()
num = a[0]

for i in a:
  num = (num+i)/2
print(num)

N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
    for i in ls:
        val = (val + i) / 2
print(val)

n=int(input())
v=list(map(int,input().split()))
v.sort()
ans=v[0]
for i in v:
  ans=(ans+i)/2
print(ans)

N = int(input())
v = list(map(int, input().split()))

v.sort()
while True:
  x = v[0]
  y = v[1]
  z = (x+y) / 2
  v.pop(0)
  v.pop(0)
  v.append(z)
  v.sort()
  if len(v) == 1:
    break
  else:
    pass
  

print(z)

n = int(input())
line = list(map(int, input().split()))
line.sort()
ans = (line[0] + line[1])/2
if n == 2:
  print(ans)
else:
  for i in range(2,n):
    ans = (ans + line[i]) / 2
  print(ans)

n = int(input())
vn = sorted(list(map(int, input().split())))


class Solution:
    def __init__(self, n, vn):
        self.n = n
        self.vn = vn

    def answer(self):
        ans = vn[0]
        for i in range(1, self.n):
            ans = (ans + self.vn[i]) / 2
        print(ans)


conditions = Solution(n, vn)
conditions.answer()


input();a=sorted(map(int,input().split()))
while len(a)>1:
  a.append((a.pop(0)+a.pop(0))/2);a.sort()
print(*a)

n = int(input())
u = list(map(int,input().split()))
u.sort()
value = (u[0] + u[1]) / 2
for i in range(2,n):
    value = (value + u[i]) / 2
print(value)

#ABC138C
n = int(input())
v = sorted(list(map(int,input().split())))
ans = (v[0]+v[1])/2
for i in range(2,n):
    ans = (ans+v[i])/2
print(ans)


_ = input()
v = list(map(int,input().split()))
v.sort()
num = v[0]
for i in v:
  num = (num+i)/2
print(num)

N = int(input())
V = list(map(int, input().split()))

V.sort()

res = V[0]

for i in range(1, N):
    res += V[i] * 2**(i - 1)

print(res / 2**(N - 1))

n = int(input())
v = list(map(int,input().split()))
v.sort()
v0 = v[0]
for i in range(1,n):
    v0 = (v0 + v[i]) / 2
print(v0)

import heapq
n = int(input())
h = list(map(int, input().split()))
heapq.heapify(h)

while len(h) >= 2:
  x = heapq.heappop(h)
  y = heapq.heappop(h)
  z = (x+y)/2.0
  heapq.heappush(h, z)

print(h[0])

N = int(input())
v = [int(i) for i in input().split()]
w = sorted(v)

ans = w[0] + w[1]
if N == 2:
    ans /= 2
else:
    for i in range(2, N):
        ans += 2**(i-1) * w[i]
    ans /= 2**(N-1)

print(ans)

import itertools
N = int(input())
v = list(map(int, input().split()))

for _ in range(N - 1):
    c = list(itertools.combinations(v, 2))

    x = 10000
    idx = None
    for i, j in enumerate(c):
        a = (j[0] + j[1]) / 2
        if x > a:
            x = a
            idx = i

    n = v.index(c[idx][0])
    v.pop(n)
    m = v.index(c[idx][1])
    v.pop(m)
    v.append(x)
    
print(v[0])

def solve():
    N = int(input())
    A = list(map(int, input().split()))
    A.sort()
    for i in range(N - 1):
        A[i + 1] = (A[i + 1] + A[i]) / 2
    print((A[-1]))
    return

solve()


n = int(input())
v = list(map(int, input().split()))
v.sort()
c = v[0]
for i in range(1,n):
  c = (v[i]+c)/2
print(c)

n = int(input())
v = list(map(int, input().split()))

v = sorted(v)

ans = v[0]

for i in range(1, n):
    ans = (ans+v[i])/2

print('{:.6f}'.format(ans))

#import math
#import itertools
#import numpy as np
import heapq
#from collections import deque
# sys.setrecursionlimit(10 ** 6)
#mod = 10 ** 9 + 7
#INF = 10 ** 9
#PI = 3.14159265358979323846

INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))

def do():
    n=INT()
    v=LIST()
    heapq.heapify(v)
    for i in range(n-1):
        a=heapq.heappop(v)
        b=heapq.heappop(v)
        heapq.heappush(v,(a+b)/2)
    print(heapq.heappop(v))
def __starting_point():
    do()
__starting_point()

# Nを取得
N = int(input())

# vを取得
v = list(map(int, input().split()))

# vを昇順ソート
v = sorted(v)

# result = v[0] vの小さい値から1つ選ぶ
result = v[0]

# vの2番目の値と平均をとる。これを4番目〜N番目 result = (results + v[i]) / 2
for i in range(1, len(v)):
    result = (result + v[i]) / 2

# 結果出力
print(result)

N = int(input())
v = [int(c) for c in input().split()]

v.sort()
tmp = 0.0
for i in range(N):
    if i == 0:
        tmp = v[i]
    else:
        tmp = (tmp+v[i])/2.0

print(tmp)

N = int(input())
materials = list(map(int, input().split()))

for _ in range(N-1):
	materials.sort()
	new_material = (materials[0] + materials[1])/2
	materials.pop(0)
	materials.pop(0)
	materials.append(new_material)
	
print(materials[0])

#!/usr/bin/env python3

def main():
    n = int(input())
    v = sorted(map(int, input().split()))
    ans = v[0]
    for i in range(1,n):
        ans = (ans+v[i])/2
    print(ans)

def __starting_point():
    main()

__starting_point()

# coding: utf-8

def main():
    N = int(input())
    v = list(map(int, input().split()))
    v.sort()
    ans = v[0] / 2 ** (N - 1)
    for i in range(1, N):
        ans += v[i] / 2 ** (N - i)

    print(ans)

def __starting_point():
    main()

__starting_point()

N = int(input())
v_list = list(map(int, input().split()))

v_list_min = sorted(v_list)
ans = v_list_min[0]
for i in range(1, N):
    ans = (ans + v_list_min[i])/2

print(ans)

n = int(input())
v = sorted([int(i) for i in input().split()], reverse=True)
for i in range(n - 1):
  v[i] /= (2 ** (i + 1))
v[n-1] /= (2 ** (n - 1))
print(sum(v))

import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
    
input = sys.stdin.readline
def RD(): return input().rstrip()
def F(): return float(input().rstrip())
def I(): return int(input().rstrip())
def MI(): return map(int, input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def LF(): return list(map(float,input().split()))
def Init(H, W, num): return [[num for i in range(W)] for j in range(H)]
    
    
def main():
    N = I()
    L = LI()
    L.sort()

    ans = L[0]
    for i in L[1:]:
        ans = (ans+i)/2
    print(ans)
    
def __starting_point():
    main()
__starting_point()

N = int(input())
v = [int(c) for c in input().split()]

v.sort()
tmp = 0.0
for i in range(N):
    if i == 0:
        tmp = v[i]
    else:
        tmp = (tmp+v[i])/2.0

print(tmp)

n = int(input())
v = list(map(int,input().split()))
v = sorted(v)
a = (v[0] + v[1]) / 2
for i in range(2,n):
    a = (a + v[i]) / 2
print(a)

n = int(input())
v =list(map(int, input().split()))
l = [0]*n
s = 0
l = sorted(v)
s = l[0]
for i in range(1,n):
  s = (s+l[i])/2
print(s)

a = int(input())
b = list(map(int,input().split()))
b.sort()
c = b[0]
for i in range(1,a):
  c += b[i]
  c /= 2
print(c)

N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
a = 1
for i in range(N):
    if i != N-1:
        a *= 0.5
    ans += a*A[i]

print(ans)

n = int(input())
v = [int(n) for n in input().split()]

v = sorted(v)

ans = v[0]
for num in v[1:]:
    ans = (ans + num)/2

print(ans)

N = int(input())
v = list(map(int, input().split()))

# 昇順にソートすると、最大値を与えるのは以下の操作を行ったとき：
# v_1 = (v_0 + v_1)/2 (v_0は消滅）
# v_2 = (v_1 + V_2)/2 (v_1は消滅)
# v_(N-1) = (v_(N_1) + v_(N-2))/2 (v_(N-2)は消滅)
# 結局、(N-1)番目の素材が残り、その価値はv_(N-1)

v = sorted(v)
for i in range(N-1):
  v[i+1] = (v[i+1]+v[i])/2
  
print(v[N-1])

#入力:[n1,n2,...nk](int:整数配列)
def input_array():
	return list(map(int,input().split()))
  
n=int(input())
v=input_array()
v=sorted(v)
ans=v[0]
for i in range(1,n):
	ans=(ans+v[i])/2
print(ans)

def cumsum(n,A):
    s = [0]*(n+1)
    s[0] = A[0]
    for i in range(len(A)):
        s[i+1] = (s[i] + A[i])/2
    return s

n = int(input())
v = sorted(list(map(int,input().split())))

for i in range(n-1):
    s = cumsum(n,v)
print(s[-1])

N = int(input())
v = list(map(float, input().split()))

v.sort()

for i in range(N-1):
    v[i+1] = (v[i] + v[i+1]) / 2

print((v[-1]))


N=int(input())
vlist=list(map(int,input().split()))
vlist.sort()
ans=0
for i in range(N):
    if i==0:
        ans+=vlist[i]
    else:
        ans=(ans+vlist[i])/2
print(ans)

n = int(input())
u = list(map(int,input().split()))

u = sorted(u)
ans = 0

for i in range(n-1):
  if ans == 0:
    ans = (u[i] + u[i+1])/2
  else:
    ans = (ans + u[i+1])/2
    
print(ans)

n = int(input())
v = list(map(int,input().split()))
v.sort()
t = float(v[0]+v[1])/2

for i in range(2,n,1):
    t = float(t+v[i])/2


print(('{:.05f}'.format(t)))


n=int(input())
v=list(map(int,input().split()))

v.sort()

for i in range(1,n):
    v[i]=(v[i]+v[i-1])/2

print(v[-1])

n=int(input())
L=sorted(list(map(int,input().split())))
ans=(L[0]+L[1])/2
for i in range(2,n):
    ans=(ans+L[i])/2
print(ans)

N = int(input())
v = list(map(int, input().split()))

v = sorted(v)
for i in range(N-1):
  v[i+1] = (v[i+1]+v[i])/2
  
print(v[N-1])

M = int(input())
A = list(map(int,input().split()))
A.sort()
count = 0
count = (A[0]+A[1])/2
for i in range(2,M):
  count = (count+A[i])/2
  
print(count)

n = int(input())
lst = list(map(int,input().split()))
lst.sort()
for i in range(n - 1):
  x = (lst[0] + lst[1])/2
  lst.pop(0)
  lst.pop(0)
  lst.append(x)
  lst.sort()
print((lst[0]))


N = int(input())
V = list(map(int,input().split()))
V.sort()
a = V[0]
for i in range(1 , N):
  a  = (a + V[i]) / 2
print(a)
  
  


n=int(input())
v=list(map(int,input().split()))
v.sort()
z=(v[0]+v[1])/2
for i in range(2,n):
  z=(z+v[i])/2

print(z)

N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
rst = ls[0]
if N >= 2:
    for i in ls[1:]:
        rst = (rst + i) / 2
print(rst)

a=int(input())
b=list(map(int,input().split()))
b.sort()
c=b[0]
for i in range (a-1):
  c=(c+b[i+1])/2
print(c)

N = int(input())
V = list(map(int, input().split()))
if N == 2:
    print((V[0]+ V[1])/2)
else:
    V.sort()
    kati = V[0]
    for i in range(1, N):
        kati = (kati + V[i]) / 2
    print(kati)

# C
N = int(input())
V = sorted(list(map(int, input().split())))

ans = (V[0]+V[1])/2
for i in range(2, len(V)):
    ans = (ans+V[i])/2
print(ans)


N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
    for i in ls[1:]:
        val = (val + i) / 2
print(val)

n = int(input())
v = list(map(int, input().split()))
for i in range(n-1):
    a = min(v)
    v.remove(a)
    b = min(v)
    v.remove(b)
    new = (a+b)/2
    v.append(new)
print(new)

n = int(input())
arr = list(map(int, input().split()))

for _ in range(n - 1):
    arr.sort()
    new_v = (arr[0] + arr[1]) / 2
    del arr[0:2]
    arr.append(new_v)

print((arr[0]))


n=int(input())
A=sorted(list(map(int,input().split())))
ans = A[0]
for i in range(n-1):
  ans = (ans + A[i+1])/2
print(ans)

n=int(input())
v=sorted(list(map(int, input().split())))
res=v[0]
for i in range(n-1):
    res=(res+v[i+1])/2
print(res)


N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = A[0]
for i in range(1, N):
  ans = (ans + A[i])/2
print(ans)

n = int(input())
v = list(map(float, input().split()))

v.sort()
dp = [0]*(n-1)

for i in range(n-1):
    dp[i] += (v[i]+v[i+1])/2
    v[i+1] =  dp[i]
print((dp[-1]))


#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import heapq

def main():
    n = int(input())
    values=[]
    heap_values=[]
    values=list(map(int,input().split()))
    [heapq.heappush(heap_values, value) for value in values]

    while len(heap_values)!=1:
        tmp1=heapq.heappop(heap_values)
        tmp2=heapq.heappop(heap_values)
        tmp_value=(tmp1+tmp2)/2
        heapq.heappush(heap_values,tmp_value)

    print(heap_values[0])

def __starting_point():
    main()
__starting_point()

# -*- coding:utf-8 -*-
N = int(input())
Val = list(map(int,input().split()))
Val.sort()
for i in range(N-1):
    x = Val.pop(0)
    y = Val.pop(0)
    Val.append((x+y)/2)
    Val.sort()

print(Val[0])

N = int(input())
v = list(map(int, input().split()))
v.sort()
ans = v[0]

for i in range(N-1):
    ans = (ans+v[i+1]) / 2

print(ans)

n = int(input())
a = sorted(map(int,input().split()))
c=a[0]
for i in range(1,n):
    c=(c+a[i])/2
print(c)

import heapq

def main():
    n = int(input())
    values = [int(i) for i in input().split()]
    heapq.heapify(values)
    for i in range(n-1):
        a = heapq.heappop(values)
        b = heapq.heappop(values)
        heapq.heappush(values, (a+b)/2)
    ans = heapq.heappop(values)
    print(ans)

def __starting_point():
    main()
__starting_point()

N=int(input())
v=sorted(map(int,input().split()))
value=v[0]
for i in range(1,N):
    value=(value+v[i])/2
print(value)