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 = list(map(int,input().split(' ')))

V.sort()

for n in range(N-1):
  V.append((V[0] + V[1]) / 2)
  del V[0]
  del V[0]
  V.sort()

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 += a[i]
  ans /= 2

print(ans)

Solution (Python):
import sys 
stdin = sys.stdin
 
ns = lambda: stdin.readline().rstrip()
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
s = lambda h: [list(map(int, stdin.readline().split())) for i in range(h)]

n = ni()
v = na()
v.sort(reverse=False)
ans = v[0]

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

print(ans)

Solution (Python):
n=int(input())
v=[int(i) for i in 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())
array = [int(i) for i in input().split()]

array.sort()

sum = 0
for i in range(n):
  if i == 0:
    sum = array[0]
  else:
    sum = (sum+array[i])/2
    
print(sum)

Solution (Python):
a=[]
b=int(input())
i=0
for x in input().split(" "):
    a.append(int(x))
a.sort()
while i<b-1:
    a[i+1]=(a[i]+a[i+1])/2
    i+=1
print(a[-1])

Solution (Python):
import numpy as np
n=int(input())
v=np.array(sorted([int(i) for i in input().split(" ")]))
tmp = [1/2**(n-1)] + [1/2**(i-1) for i in range(n, 1, -1)]
print(np.sum(v*tmp))

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 = list(map(int, input().split()))

v.sort()

ans = v[0]

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

print(ans)

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
li.sort(reverse = True)
li2 = []
for i in range(N):
    soeji = i+1
    if i == N-1:
        soeji = i
    li2.append(li[i]/(2**soeji))
print(sum(li2))

Solution (Python):
import sys

input = sys.stdin.readline

N = int(input().strip())
vs = list(map(int, input().strip().split(' ')))

vs.sort(reverse=True)
value = 0
for i in range(1, N+1):
    div = 2 ** i
    if i == N:
        div = 2 ** (N - 1)
    value += vs[i-1] / div
print(value)

Solution (Python):
from functools import reduce

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

print(reduce(lambda x,y: (x + y) / 2, v))

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

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

print(z)

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

Solution (Python):
from functools import reduce
N = int(input())
V = sorted(map(int, input().split()))
avgsum = V[0]
for num in V:
    avgsum = (avgsum + num) / 2
print(avgsum)

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

for i in range(n-1):
    v.sort()
    new = (v[0]+v[1])/2
    if i < n-2:
        v = [new]+ v[2:]
    else:
        v = [new]

print(v[0])

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

for i in range(n):
    if len(v)>1:
        mean=(v[0]+v[1])/2
        v=v[2:]
        v.append(mean)
        v.sort()

print(v[0])

Solution (Python):
n = int(input())
a = list(map(int,input().split()))
a.sort()
tmp = a[0]

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

print(tmp)

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

v.sort()
tmp = (v[0]+v[1])/2
for i in v[2:]:
    tmp = (tmp+i)/2

print(tmp)

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
an = list(map(int, input().split()))
an.sort();

ans = 0

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

print(ans)

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

Solution (Python):
N = int(input())
V = list(int(i) for i in input().split())
V.sort()

while len(V) > 1:
    V.append((V[0]+V[1])/2)
    
    V.pop(0)
    V.pop(0)
    V.sort()
    
print(V[0])

Solution (Python):
import heapq

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

heapq.heapify(v)

while v:
  tmp = heapq.heappop(v)
  if v:
    tmp += heapq.heappop(v)
    heapq.heappush(v,tmp/2)
print(tmp)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v = sorted(v)
sum_ = v[0]/(2**(n-1))

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

print(sum_)

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


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

print(v[i])

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

cache = 0
for x in v:
    if cache == 0:
        cache = x
    else:
        cache = (cache+x)/2

print(cache)

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

V_list.sort()

bunsi = 2 ** (N - 1)

ans = 0
ans += V_list[0] / bunsi

for i, v in enumerate(V_list[1:]):
    ans += (v / bunsi) * 2 ** i

print(ans)

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

v.sort()
print((v[0] + sum([v[i] * 2 ** (i - 1) for i in range(1, N)])) / 2 ** (N - 1))

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

v = sorted(v)
ans = 0

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

print(v[N-1])

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

v.sort()

tmp=v.pop(0)

for i in range(N-1):
	tmp=(tmp+v.pop(0))/2

print(tmp)

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

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

v = sorted(v)

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

print(v[-1])

Solution (Python):

def solve():
    N = int(raw_input())
    v = [int(_) for _ in raw_input().split()]
    v.sort()
    new_mat = v[0]
    for i in range(1, N):
        new_mat = (new_mat + v[i]) / 2.0
    print new_mat

if __name__ == '__main__':
    solve()

Solution (Python):
def main():
    _ = int(input())
    v = sorted([int(x) for x in input().split()])
    
    for num in range(len(v) - 1):
        v[num + 1] = (v[num] + v[num + 1]) / 2
    print(v[-1])

if __name__ == "__main__":
    main()

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

v.sort()

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

print(sum)

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

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

Solution (Python):
n,*V=list(map(int,open(0).read().split()))

V.sort()
total=(V[0]+V[1])/2
for v in V[2:]:
  total = (total+v)/2
print(total)

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

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

i = 0
sorted_v = sorted(v)
t = sorted_v[0]
for x in sorted_v:
    t = (t + x)/2
    
print(t)

Solution (Python):
n = int(input())
array = [int(i) for i in input().split()]

array.sort()

sum = 0
for i in range(n):
  if i == 0:
    sum = array[0]
  else:
    sum = (sum+array[i])/2
    
print(sum)

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

newv=sorted(v)

for i in range(n-1):
    if i==0:
        sum=(newv[0]+newv[1])/2
        continue
    else:
        sum=(sum+newv[i+1])/2

print(sum)

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

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

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

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


ans = v[0]
for k in range(1,N):
    ans = (ans+v[k])/2.

print(ans)

Solution (Python):
from sys import stdin

N = int(stdin.readline().rstrip())
V = [float(x) for x in stdin.readline().rstrip().split()]

V.sort(reverse=True)
ans = 0

while len(V) > 1:
    ans += (V[len(V) - 1] + V[len(V) - 2]) / 2
    new = (V[len(V) - 1] + V[len(V) - 2]) / 2
    V.pop()
    V.pop()
    V.append(new)

print(V[0])

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

Solution (Python):

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)

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

v = sorted(v)

ans = v[0]

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

print(ans)

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

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

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

sum = 0
for i in range(n):
    if (sum == 0):
        sum += v[i]
    else:
        sum = (sum + v[i]) / 2
print(sum)

Solution (Python):
from heapq import heapify, heappop, heappush
n = int(input())
v = list(map(int, input().split()))

heapify(v)
for i in range(n-1):
  a = heappop(v)
  b = heappop(v)
  heappush(v, (a+b)/2)
  
print(heappop(v))

Solution (Python):

import os,re,sys,operator,math,heapq,string
from collections import Counter,deque
from operator import itemgetter
from itertools import accumulate,combinations,groupby
from sys import stdin,setrecursionlimit
from copy import deepcopy

setrecursionlimit(10**6)

n=int(stdin.readline().rstrip())
v=sorted([int(i) for i in stdin.readline().rstrip().split()])
now=(v[0]+v[1])/2
for i in range(2,n):
    now=(now+v[i])/2
print(now)

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

Solution (Python):
def acinput():
    return list(map(int, input().split(" ")))

import numpy as np

N=int(input())
V=sorted(acinput())

res=V[0]
for i in range(N):
    res=(res+V[i])/2

print(res)

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

Solution (Python):
N = int(input())
v = sorted([int(x) for x in input().split()])
for i in range(1, N):
    v[i] = (v[i]+v[i-1])/2
else:
    print(v[N-1])

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

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

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

print(ans)

Solution (Python):
n=int(input())
lis=list(map(int,input().split()))
lis.sort()
a=(lis[0]+lis[1])/2
ans=[a]
if n>=3:
    for i in range(n-2):
        b=(ans[i]+lis[i+2])/2
        ans.append(b)

print(ans[n-2])

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

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

V = sorted(V)

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 = list(map(int,input().split()))

v_list.sort()

value = v_list[0]

for i in v_list[1:]:
    value = (value + i)/2

print(value)

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

Solution (Python):
import heapq as q

def main():
	n = int(input())
	a = list(map(int,input().split()))
	s = []
	for i in a:
		q.heappush(s,i)
	while len(s) != 1:
		a = q.heappop(s)
		b = q.heappop(s)
		q.heappush(s,(a+b)/2)
	print(q.heappop(s))
main()

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

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

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

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

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

print(ans)

Solution (Python):

from __future__ import division, print_function

import os
import sys
from io import BytesIO, IOBase

if sys.version_info[0] < 3:
    from __builtin__ import xrange as range
    from future_builtins import ascii, filter, hex, map, oct, zip


def main():
    n = int(input())
    v = sorted([int(i) for i in input().split()])

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

    print(j)




BUFSIZE = 8192


class FastIO(IOBase):
    newlines = 0

    def __init__(self, file):
        self._fd = file.fileno()
        self.buffer = BytesIO()
        self.writable = "x" in file.mode or "r" not in file.mode
        self.write = self.buffer.write if self.writable else None

    def read(self):
        while True:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            if not b:
                break
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines = 0
        return self.buffer.read()

    def readline(self):
        while self.newlines == 0:
            b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
            self.newlines = b.count(b"\n") + (not b)
            ptr = self.buffer.tell()
            self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
        self.newlines -= 1
        return self.buffer.readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.buffer.getvalue())
            self.buffer.truncate(0), self.buffer.seek(0)


class IOWrapper(IOBase):
    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        self.write = lambda s: self.buffer.write(s.encode("ascii"))
        self.read = lambda: self.buffer.read().decode("ascii")
        self.readline = lambda: self.buffer.readline().decode("ascii")


def print(*args, **kwargs):
    """Prints the values to a stream, or to sys.stdout by default."""
    sep, file = kwargs.pop("sep", " "), kwargs.pop("file", sys.stdout)
    at_start = True
    for x in args:
        if not at_start:
            file.write(sep)
        file.write(str(x))
        at_start = False
    file.write(kwargs.pop("end", "\n"))
    if kwargs.pop("flush", False):
        file.flush()


if sys.version_info[0] < 3:
    sys.stdin, sys.stdout = FastIO(sys.stdin), FastIO(sys.stdout)
else:
    sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)

input = lambda: sys.stdin.readline().rstrip("\r\n")



if __name__ == "__main__":
    main()

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

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

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

V = sorted(V)

for i in range(N - 1):
	V[0] = (V[1] + V[0]) / 2
	if len(V) == 1:
		break
	else:
		V.pop(1)
print(V[0])

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

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()
out = (v[0]+v[1])/2

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

print(out)

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re,  array, bisect, sys, random, time, copy, functools, os, queue
sys.setrecursionlimit(10**7)
inf = 10 ** 20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]
ddn = [(-1, 0), (-1, 1), (0, 1), (1, 1), (1, 0), (1, -1), (0, -1), (-1, -1)]
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def _I(): return int(sys.stdin.readline())
def _F(): return float(sys.stdin.readline())
def _pf(s): return print(s, flush=True)
def perr(s): return print(s, file=sys.stderr)


N = _I()


V = queue.PriorityQueue()
for v in LI():
    V.put(v) 
initial = True
while not V.empty():
    current = V.get()
    new = (current + V.get())/2
    if V.empty():
        V.put(new)
        break

    V.put(new)

print(V.get())

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
A.sort()
total=(A[0]+A[1])/2
if N>=3:
    for i in range(2,N):
        total=(total+A[i])/2
print(total)

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

for _ in range(n-1):
  v[0]=(v[0]+v[1])/2
  del v[1]
  
print(v[0])

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

v.sort()

sum = v[0]

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

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

while len(v) != 1:
  f=v[0]
  s=v[1]
  sums=(f+s)/2
  v.pop(1)
  v.pop(0)
  v.append(sums)
  v=sorted(v)

print(v[0])

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

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

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

ls = sorted(ls)

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

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

ans = 0
v.sort()

tmp = 0.5 * (v[0] + v[1])

if n == 2:
    print(tmp)
    exit()

for i in range(n-2):
    tmp = (tmp + v[i+2]) * 0.5


print(tmp)

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

v = sorted(v, reverse=True)
ret = [v[i]/(2.0**(i+1)) for i in range(n)]

ret = sum(ret) + v[-1]/(2.0**n)

print(ret)

Solution (Python):
from heapq import heappush, heappop
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations
import sys
import bisect
import string
sys.setrecursionlimit(10**6)
def SI():
    return input().split()
def MI():
    return map(int,input().split())
def I():
    return int(input())
def LI():
    return [int(i) for i in input().split()]
YN=['Yes','No']
mo=10**9+7

n=I()
a=LI()
a=sorted(a)[::-1]
p=a.pop()
while a:
    p=(a.pop()+p)/2
print(p)

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

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

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

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

Solution (Python):
N = int(input())
v = [int(i) for i in 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())
a = list(map(int, input().split()))
a = sorted(a)
res = a[0]
for i in a:
    res = (res + i) / 2
print(res)

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

v = sorted(v)
ans = v[0]

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

print(ans)

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

sort_v = sorted(v)

for i in range(N):
  if i == 0:
    var = sort_v[0]
  if i >= 1 and i < N-1:
    var = (sort_v[i]+var)/2
  if i == N-1:
    var = (sort_v[i]+var)/2
    print(var)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v.sort()
a = 0
for i, p in enumerate(v) :
    if i == 0 :
        a += p*2**-(n-1)
    else :
        a += p*2**-(n-i)
print(a)

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

V.sort()
value = V[0]
for v in V[1:]:
    value = (value+v)/2
print(value)

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()
ans = 0
for i, v in enumerate(V):
    if i == 0:
        ans = v
    else:
        ans = float(ans + v) / 2
print(ans)

Solution (Python):


import sys

n=int( sys.stdin.readline().strip() )
v=[ int(x) for x in sys.stdin.readline().strip().split() ]
v.sort()
ans= v[0]
for i in range(1,n):
    ans= ( ans + v[i] ) / 2.0

print( ans )

Solution (Python):

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

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

print(v[0])

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v = sorted(v)
while len(v) > 1:
  a = v.pop(0)
  b = v.pop(0)
  v.append((a+b)/2)
  v = sorted(v)
  if len(v) == 1:
    break

print(*v)

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

v.sort()

for i in range(N - 1):
    a = (v[0] + v[1]) / 2
    v = v[2:]
    v.append(a)
    v.sort()

print(v[0])

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

v = sorted(v)
vc = v.copy()
for i in range(1, N):
    vc[i] = (vc[i] + vc[i-1]) / 2

print(max(vc))

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

ans = a[0]
for x in range(len(a)-1):
  ans = (ans+a[x+1])/2

print(ans)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    N = I()
    V = LI()
    V = sorted(V)
    cur = V[0]
    for i in range(1, len(V)):
        cur = (cur + V[i])/2
    print(cur)
        

main()

Solution (Python):
n = int(input())
li = sorted(list(map(int, input().split())))
r = li[0]
for i, j in enumerate(li):
    if i != 0:
        r = (r + li[i]) / 2
print(r)

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

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

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

Solution (Python):


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

sorted_v = sorted(v)

upper_sum = sorted_v[0]
for i in range(1, N):
    upper_sum += sorted_v[i] * (2 ** (i - 1))

lower = 2 ** (N - 1)

ans = upper_sum / lower
print(ans)

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

V.sort()

res = V[0]
for i in range(len(V)-1):
    res = (res+V[i+1])/2.0

print(res)

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

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

for i in range(n-1):
    v = sorted(v)
    v1 = v.pop(0)
    v2 = v.pop(0)
    v.append((v1+v2)/2)

print(v[0])

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

ans = v[0] / (2**(n-1))

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

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return list(map(int, sys.stdin.readline().split()))
def II(): return int(sys.stdin.readline())
def LS(): return list(map(list, sys.stdin.readline().split()))
def S(): return list(sys.stdin.readline())[:-1]

def main():
    n = II()
    vs = LI()
    vs = sorted(vs)
    ans = 0
    for i in range(n):
        if i == 0:
            ans += vs[i]
        else:
            ans = (ans + vs[i]) /2
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):




N = int(input())
Vn = list(map(int, input().split()))
Vn = sorted(Vn)
ans = float(Vn[0])
for v in Vn[1:]:
  ans = float((ans+v)/2)
print(ans)

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

v = sorted(v)

while (len(v) > 1):
  comp = (v.pop(0) + v.pop(0)) / 2
  v.append(comp)
  v = sorted(v)

print(v[0])

Solution (Python):


import copy
import sys
import math

n = int(input())
tmp = input().split()
hoge = list(map(lambda a: int(a), tmp))

hoge.sort()

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

print(total)

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

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

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

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

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

print(ans)

Solution (Python):
n = int(input())
a = sorted(list(map(float, input().split())))
ans = (a[0] + a[1]) / 2.0
for e in a[2:]:
  ans = (ans + e) / 2.0
print(ans)

Solution (Python):

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

A.sort()


ans = (A[0]+A[1])/2.0
for n in range(2,N):
	ans = (ans+A[n])/2.0
print(ans)

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

n2 = [int(i) for i in input().split()]

n2.sort()

s1 = n2[0]
for i1 in range(n1 - 1):
    s1 = (s1 + n2[i1 + 1]) / 2

print(s1)

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

v_ = sorted(v)

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 = sorted(list(map(int, input().split())))
v0 = v[0]
for i in range(n-1):
    v0 = (v0 + v[i+1]) / 2
print(v0)

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

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

if ans % 1 == 0:
    ans = int(ans)

print(ans)

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

Solution (Python):
n = int(input())
V = [int(el) for el in input().split(' ')]
V = sorted(V)
total = V[0]
for i in range(1,n):
    total = (total + V[i]) / 2
print(total)

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

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

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

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):
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

n = INT()
V = LIST()
V.sort()

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

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

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

Solution (Python):
from functools import reduce


def main():
    n = int(input())
    v = map(int, input().split())
    v = sorted(v)

    ans = reduce(lambda acc, x: (acc + x) / 2, v[1:], v[0])
    print(ans)


main()

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

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

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

ANS=A[0]
for a in A[1:]:
    ANS=(ANS+a)/2

print(ANS)