Problem:
 Score : 300 points    Problem Statement 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 1 2
3 4      Sample Output 1 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.       Sample Input 2 3
500 300 200      Sample Output 2 375  You start with three ingredients this time, and you can choose what to use in the first composition. There are three possible choices:   Use the ingredients of values 500 and 300 to produce an ingredient of value (500 + 300) / 2 = 400 . The next composition will use this ingredient and the ingredient of value 200 , resulting in an ingredient of value (400 + 200) / 2 = 300 .  Use the ingredients of values 500 and 200 to produce an ingredient of value (500 + 200) / 2 = 350 . The next composition will use this ingredient and the ingredient of value 300 , resulting in an ingredient of value (350 + 300) / 2 = 325 .  Use the ingredients of values 300 and 200 to produce an ingredient of value (300 + 200) / 2 = 250 . The next composition will use this ingredient and the ingredient of value 500 , resulting in an ingredient of value (250 + 500) / 2 = 375 .   Thus, the maximum possible value of the last ingredient remaining is 375 .  Printing 375.0 and so on will also be accepted.       Sample Input 3 5
138 138 138 138 138      Sample Output 3 138

Solution (Python):
n=int(input())
v=[int(x) for x in input().split()]

v=sorted(v)

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

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

print(ans)

Solution (Python):
import heapq
n=int(input())
a=list(map(int,input().split()))
heapq.heapify(a)

while len(a)!=1:
  b=heapq.heappop(a)
  c=heapq.heappop(a)
  heapq.heappush(a,(b+c)/2)
print(sum(a))

Solution (Python):
def solve(n, V):
    V.sort()
    res = V.pop(0)
    for v in V:
        res = (res + v) / 2
    return res

_n = int(input())
_V = list(map(int, input().split()))
print(solve(_n, _V))

Solution (Python):
n = int(input())
vl = list(map(int, input().split()))
vl_s = sorted(vl)

n1 = vl_s[0]
for i in range(1, n):
    n2 = vl_s[i]
    ave = (n1 + n2) / 2
    n1 = ave

print(ave)

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

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

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
ans = 0
V2 = sorted(V, reverse=True)
for i in range(N-1):
    ans += V2[i]/2**(i+1) 
ans += V2[N-1]/2**(N-1)
print(ans)

Solution (Python):
import bisect
n = int(input())
v = sorted(list(map(int, input().split())))

for i in range(n - 1):
    v_ = (v[0] + v[1]) / 2
    v.pop(0)
    v.pop(0)
    bisect.insort_left(v, v_)

print(v[0])

Solution (Python):
N = int(input())
V = sorted([float(v) for v in input().split()])

while len(V) > 1:
    if len(V) > 2:
        pick = V[0:2]
        V = [sum(pick)/2] + V[2:]
    else:
        V = [sum(V)/2]

print(V[0])

Solution (Python):
N = int(input())
lst = list(map(int,input().split(" ")))
lst.sort()
val = min(lst)
for i in range(1,len(lst)):
  val += (2**(i-1))*lst[i]
print(val/(2**(N-1)))

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

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=sorted(A)
highest_value=0
M=1
while N-1>0:
  highest_value+=B[N-1]/(2**M)
  M+=1
  N-=1 
highest_value+=B[0]/(2**(M-1))
print(highest_value)

Solution (Python):
n = int(input())
a = list(map(int, input().split()))

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

print(ans)

Solution (Python):
n = int(input())
v = [int(x) for x in input().split()]

sorted_v = sorted(v)

tmp = sorted_v[0]
for i in range(1, n):
    tmp = float((tmp + sorted_v[i]) / 2)

print(tmp)

Solution (Python):
N = int(input())
v = list(map(int, input().split()))
i = N
while i > 1:
  v.sort()
  tmp = (v.pop(0) + v.pop(0)) / 2
  v.append(tmp)
  i -= 1
print(v[0])

Solution (Python):
N = int(input())
li = list(map(int, input().split()))

t = sorted(li)
ans = 0

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

print(ans)

Solution (Python):
n = int(input())

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

v.sort()
at=v[0]
b=0
for i in range(0,n-1):
    b=(at+v[i+1])/2
    at=b
print(b)

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

Solution (Python):

import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

MOD = int(1e09) + 7

def main():
    N = cin.int()
    V = cin.mapInt()
    heapq.heapify(V)
    while len(V) >= 2:
        v = heapq.heappop(V) + heapq.heappop(V)
        v /= 2
        heapq.heappush(V,v)
    print(V[0])
    return

if __name__ == "__main__":
    main()

Solution (Python):

import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

MOD = int(1e09) + 7

def main():
    N = cin.int()
    V = cin.mapInt()
    while len(V) >= 2:
        V.sort()
        V.append((V.pop(0) + V.pop(0)) / 2)
    print(V[0])
    return

if __name__ == "__main__":
    main()

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

v.sort()

while len(v) > 1:
  a = v.pop(0)
  b = v.pop(0)
  c = [(a+b)/2]
  v = c + v
  
print(v[0])

Solution (Python):
n = int(input())
vn = [float(i) for i in input().split()]
vn.sort()
average = vn[0]
for i in range(1, n):
    average = (average + vn[i]) / 2
print(average)

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

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

Solution (Python):
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    num_list.sort()

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

    print(num_list[n-1])

if __name__ == '__main__':
    main()

Solution (Python):


n = int(input())
l = [int(x) for x in input().split()]
i =0
while len(l) >= 2:
    l.sort()
    a = l.pop(i)
    b = l.pop(i)
    c = (a + b) / 2
    l.append (c)

print(*l)

Solution (Python):


n = int(input())
l = [int(x) for x in input().split()]
i =0
while len(l) >= 2:
    l.sort()
    a = l.pop(i)
    b = l.pop(i)
    c = (a + b) / 2
    l.append (c)

print(*l)

Solution (Python):
from functools import reduce

N = int(input())
v = sorted(map(int, input().split()))
print(reduce(lambda x, y: (x + y) / 2, v))

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

v_s = sorted(v)

for i in range(len(v_s)-1):
    v_s[i+1] = (v_s[i] + v_s[i+1]) / 2
    v_s[i] = 0

print(sum(v_s))

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())))

ans = l[0]

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

print(ans)

Solution (Python):
n,*a=map(int,open(0).read().split())
a.sort()
tmp=(a[0]+a[1])/2
for i in range(2,n):
  tmp=(tmp+a[i])/2
print(tmp)

Solution (Python):
def mix(x, y):
    return (x + y) / 2
    
N = int(input())
*V, = map(int, input().split())
V.sort()
ans = V[0]
for i in range(1, N):
    ans = mix(ans,V[i])
print(ans)

Solution (Python):
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
ans = (v[0]+v[1])/2
count = 0
for i in range(2,n):
    count=(ans+v[i])/2
    ans = count
if n <=2:
    print(sum(v)/2)
else:
    print(count)

Solution (Python):
n = int(input())
values = sorted(list(map(int, input().split())))

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

print(values[n - 1])

Solution (Python):
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)

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

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

print(result)

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

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

Solution (Python):
N = int(input())
Vs = list(map(int, input().split()))
Vs = sorted(Vs)
value = Vs[0]

for i in Vs[1:]:
    value += i
    value /= 2

print(value)

Solution (Python):
N = int(input())
Vs = list(map(int, input().split()))
value = 0
prop = 1

for i in range(N-2):
    MAX = max(Vs)
    prop = 0.5**(i+1)

    value += MAX * prop
    
    Vs.remove(MAX)

value += (Vs[0] + Vs[1]) * (prop/2)

print(value)

Solution (Python):
n = int(input())
L = []
value = 0
L = list(map(int, input().split()))

L2 = sorted(L)
value = (L2[0] + L2[1]) / 2
for j in range(2, n):
    value = (L2[j] + value) / 2

print(value)

Solution (Python):
n=int(input())
vi=[]
for i in map(int,input().split()):
    vi.append(i)

vi.sort(reverse=True)

r=0.5
vsum=vi[0]*r

ri=0.5
for i in range(n-1):
    ri=ri*r
    vsum=vsum+vi[i+1]*ri
vsum=vsum+vi[i+1]*ri

print(vsum)

Solution (Python):
n = int(input())
V = list(map(int,input().split()))
for i in range(n-1):
    V.sort()
    for j in range(n-1):
        if V[j] == 0:
            continue
        else:
            Vx = (V[j]+V[j+1])/2
            V[j] = 0
            V[j+1] = Vx

print(V[n-1])

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

v.sort(reverse=True)

for i in range(n-1):
    val = (v.pop()+v.pop())/2
    v.append(val)

print(v[0])

Solution (Python):
_,v=open(0)
s,*v=sorted(map(int,v.split()))
for i in v:
  s = (s+i)/2
print(s)

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

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v.sort()
value = 0
for i in range(n):
    if i == 0:
        value += v[i]
    else:
        value += v[i]
        value /= 2
print(value)

Solution (Python):
N = int(input())
v = list(map(int,input().split()))
v.sort(reverse=True)
print(sum([v[i]*0.5**(i+1) for i in range(N-1)]+[v[N-1]*0.5**(N-1)]))

Solution (Python):
import heapq

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

heapq.heapify(vs)

while len(vs) >= 2:
    t1 = heapq.heappop(vs)
    t2 = heapq.heappop(vs)
    value = (t1 + t2) / 2
    heapq.heappush(vs, value)

print(vs[0])

Solution (Python):
from functools import reduce
N = int(input())
values = sorted([int(i) for i in input().split()])

print(reduce(lambda a, b: (a + b)/2, values))

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
V = sorted(v, reverse=True)
ans = 0
for i in range(n-1):
    ans += V[i]/(2**(i+1))
print(ans+V[n-1]/(2**(n-1)))

Solution (Python):
N = int(input())
v = list(map(int, input().split()))
v.sort()

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

Solution (Python):
n=int(input())
vlis=sorted(list(map(int,input().split())))
while len(vlis)>=2:
	a,b=vlis[0],vlis[1]
	vlis.pop(0)
	vlis.pop(0)
	vlis.insert(0,(a+b)/2)
print(vlis[0])

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

hoge = [1,1]
for i in range(1,N-1):
    hoge.append(2**i)

V.sort()
ans = 0
for i in range(len(hoge)):
    ans += hoge[i] * V[i]
print(ans/2**(N-1))

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

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

v.sort()

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

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

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

v = sorted(v)
avg = 0


for i in range(len(v)):
  if i == 0:
    pass
  elif i == 1:
    avg = (v[0]+v[1])/2
  else:
    avg = (avg+v[i])/2
  
print(avg)

Solution (Python):
N = int(input())
dv = list(map(int, input().split()))
dv = sorted(dv)

tmp = dv[0]
for d in dv[1:]:
    tmp = (tmp + d) / 2

print(tmp)

Solution (Python):
n = int(input())
vs = list(map(int, input().split()))

vs.sort(reverse = True)

for i in range(n - 1):
  pan = vs.pop()
  vs[-1] = (pan + vs[-1]) / 2

print(vs[0])

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
for i in range(n - 1):
    v.sort()
    tmp = (v.pop(0) + v.pop(0)) / 2
    v.append(tmp)
    if len(v) == 1:
        break


print(v[0])

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

v = sorted(v)

mean = v[0]

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

print(mean)

Solution (Python):
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N=II()
Vs=LI()
Vs.sort()

value = Vs[0]
for i in range(1, N):
    value = (value + Vs[i]) * 0.5

print(value)

Solution (Python):
def main():
    n = int(input())
    v = list(map(int, input().split()))
    v.sort()

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

if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
v=[int(x) for x in input().split()]

buf=sorted(v)

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

print(buf[-1])

Solution (Python):
def ans(H):
  if len(H) == 2:
    return (H[0]+H[1])/2
  else:
    n = len(H)
    return (ans(H[0:n-1])+H[n-1])/2

N = int(input())
H = [int(x) for x in input().split()]
H.sort()

print(ans(H))

Solution (Python):
N = int(input())
v = list(map(int, input().split()))
v.sort(reverse=True)
s = 0

for n in range(N):
    if n != N-1:
        s += v[n] / (2 ** (n+1))
    else :
        s += v[n] / (2 ** n)

print(s)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
a=sorted(v)
if n==2:
    ans=(a[0]+a[1])/2
    print(ans)
    exit()
awase=(a[0]+a[1])/2
for i in range(2,n-1):
    awase=(awase+a[i])/2
awase=(awase+a[n-1])/2
print(awase)

Solution (Python):
def main():
    N = int(input())
    v = sorted(list(map(int, input().split())))
    while len(v) > 1:
        x = v.pop(0)
        y = v.pop(0)
        v.append((x+y)/2)
        v = sorted(v)
    print(v[0])


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
v = [i for i in map(int,input().split())]
import heapq
heapq.heapify(v)

while len(v) >= 2:
  a = heapq.heappop(v)
  b = heapq.heappop(v)
  heapq.heappush(v,(a+b)/2)
  
print(heapq.heappop(v))

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

Solution (Python):
import sys

def main():
    N = int(input())
    Vs = list(map(int, input().split()))

    new_Vs = sorted(Vs)

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

    print(sol)

main()

Solution (Python):
num = int(input())
val = list(map(int,input().split()))

val.sort()

while len(val) > 1:
    val[0] = (val[0]+val[1])/2
    val.pop(1)

print(val[0])

Solution (Python):
def main():
    N = int(input())
    v = list(map(int, input().split(" ")))
    while len(v) > 1:
        v.sort(reverse=True)
        a = v[-1]
        b = v[-2]
        v = v[:-2]
        v.append((a + b) / 2)
    print(v[0])


if __name__ == '__main__':
    main()

Solution (Python):
n = int(input())
vi = list(map(int, input().split()))

vi.sort()

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

Solution (Python):
n = int(input())
V = list(map(int, input().split()))
V.sort()

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

print(answer)

Solution (Python):
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)

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

Solution (Python):
N = int(input())
v_list = sorted(list(map(int,input().split())))
ans = (v_list[0]+v_list[1])/2
if N != 2:
    for i in range(2,N):
        ans = (ans + v_list[i])/2
print(ans)

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

Solution (Python):
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
    v[i] = 0

print(sum(v))

Solution (Python):
n = int(input())
v = sorted([int(i) for i in input().split()], reverse=True)

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

Solution (Python):
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)

Solution (Python):
from collections import deque
n = int(input())
value = list(map(int, input().split(" ")))
value.sort()
value = deque(value)
que = deque()
ans = 0
a = value.popleft()
b = value.popleft()
c = (a+b)/2
que.append(c)
while value:
  a = value.popleft()
  c = que.popleft()
  c = (a+c)/2
  que.append(c)
ans = que[0]
print(ans)

Solution (Python):
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[N-1])

Solution (Python):
n=int(input())
v=sorted(list(map(int,input().split())),reverse=False)

ave=v.pop(0)
while True:
  tmp=v.pop(0) 
  ave=(ave+tmp)*0.5
  if len(v)==0:
    print(ave)
    exit()

Solution (Python):
from heapq import *

n=int(input())
inputs=lambda:map(int,input().split())
v=inputs()
u=[]
for i in v:
  heappush(u,i)
for j in range(n-1):  
  a1=heappop(u)
  a2=heappop(u)
  ave=(a1+a2)/2
  heappush(u,ave)
print(u[0])

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

Solution (Python):
import numpy as np
n=int(input())
v=list(map(int,input().split()))
v.sort()
ans=0
for i in range(1,n+1):
    if i<=2:
        ans+=v[i-1]/(2**(n-1))
    else:
        ans+=v[i-1]/(2**(n+1-i))
print(ans)

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

def main():
    V.sort()
    ans = V[0]
    for i in range(1,N):
        ans = (ans + V[i])/2
    print(ans)
    return

if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
v_i = list(map(int, input().split()))

A = 0
B = 0

while len(v_i) != 1:
    A = min(v_i)
    del v_i[v_i.index(A)]
    B = min(v_i)
    del v_i[v_i.index(B)]
    v_i.append((A + B) / 2)

print(v_i[0])

Solution (Python):
import functools


input()
v = [int(i) for i in input().split()]
v.sort()
ans = functools.reduce(lambda x, y: (x + y) / 2, v)
print(ans)

Solution (Python):
n = int(input())
l = sorted(list(map(int, input().split())))

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

print(l[-1])

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

Solution (Python):
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
  v[i-1]=0
print(sum(v))

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

v.sort()

while True:
	if len(v)==1:
		break
	tmp=(v[0]+v[1])/2
	v.pop(0)
	v.pop(0)
	v.insert(0,tmp)

print(v[0])

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

V.sort()


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

print(ans)

Solution (Python):
n = int(input())
ls_v = list(map(int, input().split()))

ls_sv = sorted(ls_v)
ans = ls_sv[0]

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

print(ans)

Solution (Python):
n = int(input())

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

v.sort()
v.reverse()

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

a += v[-1]/(2**(n-1))

print(a)

Solution (Python):
N=int(input().strip())
V = list(map(int, input().strip().split()))

V.sort()
ans=0
for i in range(1,N):
    ans+=V[-i]/2**i
ans+=V[0]/2**(N-1)
print(ans)

Solution (Python):
n=int(input())
a=input().split()
a = [int(i) for i in a]
a.sort()
ans=int(a[0])
for i in range(n-1):
    ans=(ans+a[i+1])/2
print(ans)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
v.sort()
v.reverse()
ans=0
for i in range(n-2):
    v[i]=v[i]/(2**(i+1))
    
v[n-2]=v[n-2]/(2**(n-1))
v[n-1]=v[n-1]/(2**(n-1))

for j in range(n):
    ans+=v[j]
print(ans)

Solution (Python):
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])

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
V.sort(reverse=True)
while len(V) > 1:
    new = (V[-1] + V[-2]) / 2
    V = V[:-2] + [new]

print(V[0])

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
V.sort(reverse=True)
while len(V) > 1:
    new = (V[-1] + V[-2]) / 2
    V = V[:-2] + [new]

print(V[0])

Solution (Python):
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)

Solution (Python):
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)

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

if len(v) == 1:
    print(v[0])
else:
    for i in range(1, len(v)):
        tmp = (v[i-1] + v[i]) / 2
        v[i] = tmp
print(tmp)

Solution (Python):
n = int(input().strip())
V = sorted(map(int, input().strip().split()))

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

print(max(V[1:]))

Solution (Python):
n = int(input())
v = list(map(int, input().strip().split()))

v = sorted(v, reverse=True)

while len(v) > 1:
    a = v.pop(-1)
    b = v.pop(-1)
    c = (a + b) / 2
    v.append(c)
    v = sorted(v, reverse=True)

last = v[0]
print(last)

Solution (Python):




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

while len(V) > 1:
    V.sort(reverse=True)
    new = (V[-1] + V[-2]) / 2
    V = V[:-2]
    V.append(new)

print(V[0])

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

Solution (Python):
N = int(input())
li = list(map(int, input().split()))
sli = sorted(li)
temp = sli[0]
for i in range(N-1):
    temp = (temp+sli[i+1])/2
print(temp)

Solution (Python):
N = int(input())
U = [int(i) for i in input().split()]
U = list(sorted(U))
ans = (U[0] + U[1]) / pow(2.0, N - 1)
for i in range(2, N):
    ans += U[i] / pow(2.0, N - i)
print(ans)

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

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
list.sort(v)

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

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
arr = [int(x) for x in stdin.readline().rstrip().split()]


val = 0
arr.sort()
for i,el in enumerate(arr):
    if i == 0:
        ex = el
        pass
    ex = (ex + el)/2
print(ex)

Solution (Python):
import sys
sys.setrecursionlimit(2147483647)
INF=float("inf")
MOD=10**9+7
input=lambda:sys.stdin.readline().rstrip()
def resolve():
    n=int(input())
    V=list(map(int,input().split()))
    V.sort(reverse=1)

    ans=V.pop()
    while(V):
        v=V.pop()
        ans=(ans+v)/2

    print(ans)
resolve()

Solution (Python):
n=int(input())
a=list(map(int,input().split()))
a.sort()
i=0
s=0
s=a[0]
i=1
while(i<n):
    s=(s+a[i])/2
    i+=1
print(s)

Solution (Python):
import heapq
N = int(input())
V = [int(_) for _ in input().split()]
heapq.heapify(V)

for n in range(N - 1):
    a = heapq.heappop(V)
    b = heapq.heappop(V)
    heapq.heappush(V, (a + b) / 2)
print(heapq.heappop(V))

Solution (Python):
n = int(input())
li = list(map(int, input().split())) 
li.sort()
res=li[0]
for i in range(1,len(li)):
    res+=li[i]
    res/=2
print(res)

Solution (Python):

import numpy as np

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

v = sorted(list(v))
res = np.mean([v[0], v[1]])

for i in range(2, N):
  res = np.mean([res, v[i]])
  
print(res)

Solution (Python):

import heapq

class PriorytyQueue(object):

    def __init__(self, arr, target='min'):
        self.arr = arr
        self.target = target
        self._heapify()
    
    def _heapify(self):
        if self.target == 'max':
            self.arr = list(map(lambda x:x*(-1), self.arr))
        heapq.heapify(self.arr)
    
    def push(self, x):
        if self.target == 'max':
            x *= -1
        heapq.heappush(self.arr, x)

    def pop(self):
        res = heapq.heappop(self.arr)
        if self.target == 'max':
            return res*(-1)
        else:
            return res
    
    def get_arr(self):
        if self.target == 'max':
            return list(map(lambda x:x*(-1), self.arr))
        else:
            return self.arr
    
    def is_empty(self):
        return len(self.arr) == 0

N = int(input())
v = list(map(int, input().split()))
pq = PriorytyQueue(v, target='min')
for i in range(N-1):
    min1 = pq.pop()
    min2 = pq.pop()
    pq.push((min1+min2)/2)
print(pq.pop())

Solution (Python):
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)

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

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
v.sort()
while len(v)>1:
    a=v.pop(0)
    b=v.pop(0)
    v.append((a+b)/2)
    v.sort()
print(v[0])

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

while True:
    if len(v) == 1:
        print(v[0])
        break
    tmp = (v[0] + v[1]) / 2
    v.pop(0)
    v.pop(0)
    v.insert(0, tmp)

Solution (Python):
n = int(input())
V = sorted(list(map(int,input().split())))
tmp=V[0]
for v in V[1:]:
    tmp = (tmp+v)/2
print(tmp)

Solution (Python):
def main():
    N = int(input())
    v_list = list(map(int, input().split()))
    v_sorted_list = sorted(v_list)
    value = v_sorted_list[0]
    for v in sorted(v_list):
        value = (value + v) / 2

    print(value)


if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
A = list(map(int, input().split()))

A.sort()
tmp = A[0]
for i in range(1, len(A)):
    tmp = (tmp + A[i]) / 2
print(tmp)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys

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

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

print(v[-1])

Solution (Python):

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])/2
print(ans)

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v.sort()
ans=v.pop(0)
def func(x,y):
    return (x+y)/2
while v!=[]:
    ans=func(ans,v.pop(0))
print(ans)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
V.sort()
while True:
    if len(V) > 1:
        V.append((V[0]+V[1])/2)
        V.pop(0)
        V.pop(0)
    if len(V) == 1:
        break
    V.sort()
print(*V)

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

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

print(v[-1])