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()

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

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

v = sorted(v)

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

print(v[0])

Solution (Python):
n = int(input())
lst = []
s = input().rstrip().split(' ')
for j in range(n):
  lst.append(int(s[j]))
lst.sort()
for i in range(n-2):
  temp = (lst[0] + lst[1]) /2
  del lst[1]
  del lst[0]
  lst.append(temp)
  lst.sort()
ans = (lst[0] + lst[1]) / 2
print(ans)

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

v.sort()
value = 0
for i, x in enumerate(v):
    if i < 2:
        value += x
    else:
        value += x * (2 ** (i - 1))
print(value / 2 ** (len(v) - 1))

Solution (Python):

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


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

Solution (Python):
def main():
    N = int(input())
    V = [int(v) for v in input().split()]
    V = sorted(V)
    val = (V[1]+V[0])/2.0
    for i in range(2, N):
        val = (val + V[i])/2.0
    print(val)
if __name__ == "__main__":
    main()

Solution (Python):
from functools import reduce

n = int(input())

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

ans = reduce(lambda a, b: (a + b) / 2, v_list)
print(ans)

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

S=sorted(S)
sum=0
for i in range(0,N-1):
  A=(S[0]+S[1])/2
  del S[0:2]
  S.insert(0,A)
  
print(S[0])

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

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

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

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


def saiki(n):
    m = ((n[0] + n[1]) / 2)
    n.pop(0)
    n.pop(0)
    n.insert(0, m)
    if (len(n) == 1):
        print(n[0])
        exit()
    saiki(n)


print(saiki(U))

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


def saiki(n):
    m = ((n[0] + n[1]) / 2)
    n.pop(0)
    n.pop(0)
    n.insert(0, m)
    if (len(n) == 1):
        print(n[0])
        exit()
    saiki(n)


print(saiki(U))

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

Solution (Python):
from collections import deque
N = int(input())
li = list(map(int, input().split()))
d = deque(sorted(li))
while len(d) != 1:
    x = d.popleft()
    y = d.popleft()
    temp = (x+y)/2
    d.appendleft(temp)
print(d[0])

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

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

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

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

Solution (Python):
import sys
input = sys.stdin.readline

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):
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):
import sys
input = sys.stdin.readline


def main():
    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)


if __name__ == '__main__':
    main()

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

for i in range(N-1):
    k=min(v)
    v.remove(k)
    l=min(v)
    v.remove(l)
    new=(k+l)/2
    v.append(new)

print(*v)

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

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

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

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

lv.sort()

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

print(lv[0])

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

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

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

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

v.sort()

w = []

w0 = (v[0] + v[1])/2
w.append(w0)

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

print(w[n-2])

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):
from collections import deque
N = int(input())
v = list(map(int, input().split()))

d = deque(sorted(v))

ans = 0
while len(d) > 1:
    ans = 0
    ans += d.popleft()
    ans += d.popleft()
    d.appendleft(ans / 2)
print(d.pop())

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())
U = list(map(int, input().split()))
U.sort()
ans = (U[0] + U[1]) /2
U.pop(0)
U.pop(0)
for i in range(len(U)):
    ans = (ans + U[0]) /2
    U.pop(0)
print(ans)

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

Solution (Python):
N = int(input())
V = sorted([int(v) for v in input().split()])
val = V[0]
for v in V[1:]:
    val = (val + v) / 2
print(val)

Solution (Python):
n = int(input())
values = [int(i) for i in input().split()]
values.sort()
ans = values[0]
for i in range(1, n):
    ans = (ans + values[i]) / 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-1]+v[i])/2

print(v[n-1])

Solution (Python):
n=int(input())
vs=sorted(map(int,input().split()))
ans=(vs[0]+vs[1])/2
for i,j in enumerate(vs):
  if i<2: continue
  ans=(ans+j)/2
print(ans)

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

v_sort = sorted(v)

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

print(v_value)

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

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

Solution (Python):
import heapq

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

heapq.heapify(v)
while len(v) > 1:
    v1 = heapq.heappop(v)
    v2 = heapq.heappop(v)
    heapq.heappush(v, (v1 + v2) / 2)
print(v[0])

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
v = LIST()

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

Solution (Python):
N=int(input())
v=[int(x) for x in input().rstrip().split()]
v.sort()
ans=0
now=(v[0]+v[1])/2
if 2<=N:
  for i in range(2,N):
    now=(now+v[i])/2

print(now)

Solution (Python):

import io
import math

data = int(input())
array = [int(x) for x in input().split()]
array.sort()
for i in range(1,data):
  array[:2] = [(array[0]+array[1])/2]

print(array[0])

Solution (Python):
import sys

n, *v = map(int, sys.stdin.read().split())
v.sort()

def main():
    res = v[0]
    for i in range(1, n):
        res = (res + v[i]) / 2
    print(res)
    
if __name__ ==  '__main__':
    main()

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

Solution (Python):
from functools import reduce


def main():
    N = int(input())
    v = sorted(list(map(int, input().split())))
    print(reduce(lambda x, y: (x + y) * 0.5, v))


if __name__ == '__main__':
    main()

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

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

m1=min(v)
v.remove(m1)
for i in range(N-1):
    m2=min(v)
    v.remove(min(v))
    m1=(m1+m2)/2
print(m1)

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

while v_inputs:
    if len(v_inputs)==1:
        print(v_inputs[0])
        break
    v_inputs = sorted(v_inputs)
    x=v_inputs.pop(0)
    y=v_inputs.pop(0)
    v_inputs.append((x+y)/2)

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

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

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

Solution (Python):










mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    V = sorted(readInts())
    pre_ = (V[0] + V[1])/2
    if n == 2:
        print(pre_)
        exit()
    else:
        for i in range(2,n):
            pre_ = (pre_ + V[i])/2
    print(pre_)
if __name__ == '__main__':
  main()

Solution (Python):
import heapq
n = int(input())
a = sorted(list(map(float, input().split())))
heapq.heapify(a)
for i in range(n-1):
    x = heapq.heappop(a)
    y = heapq.heappop(a)
    heapq.heappush(a, (x+y)/2)
print(a[0])

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A = sorted(A)
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()

ans = 0

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
D = [int(input()) for _ in range(N)]
"""

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

total = (V[0] + V[1]) / 2

for i in range(2, N):
    total = (total + V[i]) / 2


print(total)

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

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

while len(v) > 1:
    new_v = (v[0]+v[1]) / 2
    del v[0:2]
    v = [new_v]+v

print(v[0])

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

Solution (Python):
from heapq import heapify, heappop, heappush
N = int(input())
v = list(map(int, input().split()))
heapify(v)
while len(v)>1:
    newfood = heappop(v) + heappop(v)
    heappush(v, newfood/2)
print(heappop(v))

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

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

lis = sorted(v)

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

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

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

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

v = sorted(v)

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

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

print(b)

Solution (Python):
n = int(input())
v = sorted(map(int, input().split()))
ret = v[0]
for i in range(1, n):
    ret = (ret + v[i]) * 0.5
print(ret)

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

V.sort()
ans = 0.

if N == 2:
  ans = sum(V) / 2.
  print(ans)
  exit()
  
for i in range(N):
  if i == 0:
    ans += V[i] / pow(2,N-1)
  else:
    ans += V[i] / pow(2,N-i)
    
print(ans)

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

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

v = a[0]
for b in a[1:]:
    v = (v + b) / 2
print(v)

Solution (Python):
N = int(input())
V = [int(s) for s in input().split(' ')]
V.sort()
value = V[0]
for v in V[1:]:
    value = (value + v) / 2
print(value)

Solution (Python):
import os, sys, re, math

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

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

print(v)

Solution (Python):

N = int(input())
V = sorted([int(s) for s in input().split()])
total_value = V[0]
for i in range(1, N):
    total_value = (total_value + V[i]) / 2

print(total_value)

Solution (Python):
from functools import reduce

n = int(input())
v = sorted([int(i) for i in input().split()])
ret = reduce(lambda x, y: (x + y) / 2, v)
print (ret)

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

Solution (Python):

n = int(input())
v = list(map(int,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):


int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def solve():
    n = II()
    V = sorted(LI())
    ans = V[0]
    for i in range(1, n):
        ans = (ans + V[i]) / 2
    print(ans)

if __name__ == '__main__':
    solve()

Solution (Python):


int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

from collections import deque

def solve():
    n = II()
    V = sorted(LI())
    ans = V[0]
    for i in range(1, n):
        ans = (ans + V[i]) / 2
    print(ans)

if __name__ == '__main__':
    solve()

Solution (Python):


int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

from collections import deque

def solve():
    n = II()
    V = LI()

    V = deque(sorted(V))

    vi = V.popleft()
    while 1:
        vj = V.popleft()
        avg = (vi + vj) / 2
        V.append(avg)
        V = deque(sorted(V))

        vi = V.popleft()
        if len(V) == 0:
            break
    print(vi)

if __name__ == '__main__':
    solve()

Solution (Python):
n=int(input())
a = sorted(map(int,input().split()))
p=a[0]
for i in range(1,n):
    p = (p + a[i])/2
print('{:.8f}'.format(p))

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

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

v.sort()

for _ in range(n-1):
    a = v.pop(0)
    b = v.pop(0)
    avg = (a + b) / 2
    v.insert(0, avg)

print(v[0])

Solution (Python):
import heapq

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

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))

Solution (Python):
from fractions import Fraction
n=int(input())
a=list(map(int,input().split()))

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

print(float(ans))

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
for _ in range(N - 1):
    V.sort(reverse=True)
    x = V.pop()
    y = V.pop()
    V.append((x + y) / 2)
print(V[0])

Solution (Python):
def Alchemist(n , vl):

    vl.sort()
    ans = vl[0]

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

    return ans

def main():
    n = int(input())
    vl = list(map(int , input().split()))
    print(Alchemist(n , vl))

if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
V = [_ for _ in map(int,input().split())]
v = len(V)
V.sort()
if v == 2:
    print(sum(V)/2)
else:
    i = 2
    X = (V[0] + V[1])/2
    while i != N:
        X = (X + V[i])/2
        i += 1
    print(X)

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

v.sort()

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

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

print(x)

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

if n == 2:
  print(sum(s) / 2)

else:
  m_v = 0
  for i in range(2, n):
    m_v += 2 ** (i - 1) * s[i]
    
  print((m_v + sum(s[:2])) / (2 ** (n - 1)))

Solution (Python):
import math

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

v.sort(reverse=True)

while len(v) > 1:
    v.append((v.pop() + v.pop())/2)

print(v[0])

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())
v = sorted(list(map(int, input().split())), reverse=True)
init = 0.5
ans = 0
for i in range(N):
    ans += init * v[i]
    init *= 0.5
ans += init * 2 * v[-1]
print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
mo = 10**9+7

def main():
	n = II()
	v = LI()
	v.sort()
	ans = v[0]
	for i in range(1,n):
		ans = (ans+v[i])/2
	print(ans)

if __name__ == '__main__':
	main()

Solution (Python):
import numpy as np
import sys
n = int(input())
A= list(map(int,input().split()))
A.sort()
cnt = A[0]
for i in range(1,n):
    cnt = (cnt+A[i])/2
print(cnt)

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

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

heapq.heapify(v)
for i in range(n-1):
    v1 = heapq.heappop(v)
    v2 = heapq.heappop(v)
    heapq.heappush(v,(v1+v2)/2)
ans = heapq.heappop(v)
print(ans)

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    V=[int(_) for _ in input().split()]
    V.sort()
    ss=V[0]
    for i in range(1,n):
        ss=(ss+V[i])/2
    print(ss)

if __name__=='__main__':
    main()

Solution (Python):
def myAnswer(N:int,V:list) -> float:
   ans = 0
   V.sort()
   while len(V)!=1:
      tmp = (V.pop(0)+V.pop(0))/2
      V.append(tmp)
      V.sort()

   return V[0]

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   V = list(map(int,input().split()))
   print(myAnswer(N,V[:]))

if __name__ == '__main__':
   main()

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

nv = sorted(v)

for i in range(N-1):
    dammy = (nv[0] + nv[1]) / 2
    nv[1] = dammy
    del nv[0]
    nv = sorted(nv)

print(nv[0])

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

"""

n=int(input())
A=list(map(int,input().split()))
A.sort()
cur=(A[0]+A[1])/2

for i in range(2,n):
    cur=(cur+A[i])/2
print(cur)

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):
import sys
input = lambda: sys.stdin.readline().rstrip() 

def resolve():
    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)

if __name__ == '__main__':
    resolve()

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

Solution (Python):
from heapq import heapify, heappop, heappush

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

heapify(v)

for _ in range(N - 1):
    x = heappop(v)
    y = heappop(v)
    heappush(v, (x + y) / 2)
    
print(sum(v))

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

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

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 = 0
point = (v[0]+v[1])/2
for i in range(2, n):
    point = (point+v[i])/2

print(point)

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()
m = V[0]
for i in range(1, N):
  m += (2**(i-1)) * V[i]
m /= 2**(N-1)
print(m)

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

Solution (Python):
n = int(input())
V = list(map(int,input().split(' ')))
V.sort()
ans = 0
i = 1
while i < n+1:
    ans += V[n-i]/pow(2,i)
    i += 1
print(ans+V[0]/pow(2,n))

Solution (Python):

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

heapq.heapify(v)

while len(v)>1:
    tmp1 = heapq.heappop(v)
    tmp2 = heapq.heappop(v)
    heapq.heappush(v,(tmp1+tmp2)/2)
    
print(v[0])

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

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

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

value = sorted(value)

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

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

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

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

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

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

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

Solution (Python):
from decimal import Decimal
n = int(input())
v = list(map(int,input().split()))
sumv = sum(v)
for i in range(n-1):
    v.sort()
    sumv -= Decimal((v[0]+v[1])/2)
    v[1] = Decimal((v[0]+v[1])/2)
    v[0] = 1000000
print(sumv)

Solution (Python):
from heapq import heappop, heappush

n = int(input())
queue = []
for v in map(int, input().split()):
  heappush(queue, v)
for _ in range(n-1):
  v1 = heappop(queue)
  v2 = heappop(queue)
  heappush(queue, (v1 + v2) / 2)
print(queue[0])

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

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 = 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)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v_new = sorted(v)
while len(v_new) > 1:
    s = [(v_new[0] + v_new[1]) / 2]
    v_new = s + v_new[2:]
print(sum(v_new))

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())
vn = list(map(int, input().split()))
vn.sort(reverse=True)
for _ in range(N-1):
    new = (vn[-1] + vn[-2])/2
    vn.pop()
    vn.pop()
    vn.append(new)
print(new)

Solution (Python):
import bisect

N = int(input())
v = list(map(int, input().split()))
v.sort()
for _ in range(N - 1):
    bisect.insort(v, (v.pop(0) + v.pop(0)) / 2)

print(v[0])

Solution (Python):
n=int(input())
l=sorted(list(map(int,input().split())))
while len(l)>1:
    l.append((l[0]+l[1])/2)
    l=sorted(l[2:len(l)+1])
print(l[0])

Solution (Python):
import sys
import heapq
stdin=sys.stdin

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))


N=int(input())
V=nl()
h=[]
for i in V:
  heapq.heappush(h,i) 

for i in range(N-1):
  minval=heapq.heappop(h)
  minval2=heapq.heappop(h)
  heapq.heappush(h,(minval+minval2)/2)
  
print(heapq.heappop(h))

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

while len(V) >= 2:
    v1 = heapq.heappop(V)
    v2 = heapq.heappop(V)
    heapq.heappush(V, (v1+v2)/2)
print(V[0])

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

while len(sl) > 1:
    e1 = sl.pop()
    e2 = sl.pop()
    sl.append((e1 + e2)/2)
print(sl[0])

Solution (Python):
from functools import reduce

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

add = lambda a, b: a + b
sum = lambda list: reduce(add, list, 0)

v.sort()

v0 = v[0] / 2 ** (len(v) - 1)
v.pop(0)

total = v0 + sum([vi / 2 ** (len(v) - i) for i, vi in enumerate(v)])

print(total)

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

while len(v) > 1:
    v[0] = (v[0] + v[1]) / 2
    del v[1]

print(v[0])

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

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

Solution (Python):
from functools import reduce
n = int(input())
ns = list(map(int, input().split()))
print(reduce(lambda x,y: (x+y)/2, sorted(ns)))

Solution (Python):
n=int(input())
u=list(map(int,input().split()))
u.sort()
ans=0

while len(u)>=2:
  ans=(u[0]+u[1])/2
  del u[0]
  u[0]=ans
  
print(ans)

Solution (Python):
n=int(input())
v=sorted(map(int,input().split()))
while True:
    x=v.pop(0)
    y=v.pop(0)
    v.append((x+y)/2)
    v.sort()
    if len(v)==1:
        break
print(v[0])

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

v.sort()

for i in range(len(v)):
    if i==0:
        continue

    a = v.pop(1)
    b = v.pop(0)
    v.insert(0, (a+b)/2)


print(v[0])