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())
l = sorted([int(x) for x in input().split()])
coeff_l = [n-1] + [n-x for x in range(1,n)]
coeff_l = [1*0.5**n for n in coeff_l]
result = sum([a*b for a,b in zip(l,coeff_l)])
print(result)

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

def mean(a, b):
    return (a+b)/2

result = v[0]

for i in range(1, n):
    result = mean(result, v[i])

print(result)

Solution (Python):
N = int(input())
list = [int(i) for i in input().split()]

for i in range(N-1):
  list.sort()
  num = (list[0] + list[1])/2
  list.pop(0)
  list.pop(0)
  list.insert(0, num)

print(list[0])

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

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

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

V.sort()
V = list(reversed(V))

def insert(A, t):
  for i in range(len(A)):
    if A[i] <= t:
      A.insert(i, t)
      break
  else:
    A.append(t)

while(len(V) > 1):
  v1 = V.pop()
  v2 = V.pop()
  insert(V, (v1 + v2) / 2)

print(V[0])

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())
data = sorted(list(map(int, input().split())))
total = data.pop(0)
for i,num in enumerate(data):
    total += 2**i * num
print(total/2**(N-1))

Solution (Python):
from heapq import heappush, heappop

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

h = []

for v in v_list:
    heappush(h, v)

while len(h) >= 2:
    a = heappop(h)
    b = heappop(h)
    heappush(h, (a + b) / 2)

print(heappop(h))

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

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

print(ans)

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

Solution (Python):
value = [tuple(map(int,input().split())) for i in range(2)]
lis = []
new_v = 0

for i in range(value[0][0]):
    lis.append(value[1][i])

lis.sort()

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

print(alch)

Solution (Python):
N=int(input())
v = [int(i) for i in input().split()] 
v.sort()
value=(v[0]+v[1])/2
j=0
hoge=[]
if N==2:
    print(value)
else:
    for i in range(2,N):
        value=(value+v[i])/2
    print(value)

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

Solution (Python):
from collections import defaultdict
import sys
import math
from datetime import datetime

def rec(S):
    if S is None: return 0
    elif len(S) == 1: return sum(S)
    elif len(S) == 2:
        return sum(S) / 2.0
    else: 
        S.sort()
        S[1] = (S[0] + S[1]) / 2.0
        return rec(S[1:])



def sol(n, S):
    return rec(S)



do_submit = True


def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    n = int(parsed_lines[0][0])
    S = list(map(int, parsed_lines[1]))
    
    
    return n, S


if not do_submit:
    n, S = input_parse("""
    3
    500 300 200
    """)
    print(sol(n, S))

    n, S = input_parse("""
    5
    138 138 138 138 138
    """)
    print(sol(n, S))




else:
    n = int(input().strip())
    S = list(map(int, input().split()))
    
    

    
    
    print(sol(n, S))

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

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

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

print("{:.10f}".format(ans))

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

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

Solution (Python):
def main():
    
    n = int(input())
    a = [int(e) for e in input().split()]


    b = sorted(a)
    c = (b[0]+b[1])/2
    

    for i in range(2,n):

        c = (c + b[i])/2
     
      
    print(c)


if __name__ == "__main__":
    main()

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
V.sort()
total = [V[0]]

for i in range(N)[1:N]:
  
  total.append(V[i] * 2**(i - 1))
print(sum(total) / 2 **(N - 1))

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

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

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

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

b, *not_mins = sorted(U)
for u in not_mins:
    b = (b + u) / 2

print(b)

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

if n == 2:
    print((ss[0] + ss[1]) / 2)
elif ss[0] == sum(ss) / n:
    print(ss[0])
else:
    for i in range(n - 1):
        if i == 0:
            tmp = (ss[i] + ss[i + 1]) / 2
        else:
            tmp = (tmp + ss[i + 1]) / 2
    print(tmp)

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

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

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

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

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v_new = sorted(v)
ans=0.0
for i,x in enumerate(v_new):
  if i ==0 or i==1:
    ans += 1/2**(N-1)*x
  else:
    ans += 1/2**(N-i)*x
print(ans)

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

v.sort()

for i in range(0, N-1):
    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()))
for i in range(n-1):
    if len(v)>1:
        v.append((v.pop(v.index(min(v)))+v.pop(v.index(min(v))))/2)
print(v[0])

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

q = []
for i in range(N):
    heapq.heappush(q, L[i])

while(len(q)>1):
    x = heapq.heappop(q)
    y = heapq.heappop(q)
    new = (x+y)/2
    heapq.heappush(q, new)

if len(q)==1:
    ans = heapq.heappop(q)
    print(ans)

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

s = vi[0]/pow(2,n-1) + vi[1]/pow(2,n-1)
for i,v in enumerate(vi[2:]):
    s += v/pow(2,n-2-i)

print s

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

Solution (Python):


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

a.sort()
a.reverse()

for i in range(n-1):
    x = float(a.pop())
    y = float(a.pop())
    a.append((x + y)/2)

print(a.pop())

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

Solution (Python):
import sys
import queue


		
def main():
	n = int(input())
	l = list(map(int, input().split()))
	ll=queue.PriorityQueue()
	for v in l:
		ll.put(v)

	while not ll.empty():
		ii=ll.get()
		nn=ll.get()
		nc=(ii+nn)/2
		if ll.empty():
			return nc
		ll.put(nc)
	


if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
	else:
		pass
		
			
	ret = main()
	if ret is not None:
		print(ret)

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

res = min(A)
A.remove(min(A))

while(A != []):
  res = (res + min(A)) / 2
  A.remove(min(A))
  
print(res)

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

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

bunshi = nums[0] + nums[1]
bunbo = pow(2, n - 1)

for idx in range(2, len(nums)):
    bunshi = bunshi + nums[idx] * pow(2, idx - 1)
print (bunshi/bunbo)

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

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

v.sort()

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

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

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):
def abc138_c():
    N = int(input())
    values = sorted(list(map(int, input().split())))

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

    print(values[0])

if __name__ == '__main__':
    abc138_c()

Solution (Python):
N = int(input())
v = sorted(map(float, input().split()))
ans = v[0]

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

print(ans)

Solution (Python):
if __name__ == '__main__':
	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[-1])

Solution (Python):
import functools

def gcd_list(numbers):
    return functools.reduce(fractions.gcd, numbers)


N = int(input())
ele_list = [int(i) for i in input().split(' ')]
ele_list.sort()

price = functools.reduce(lambda x,y: (x + y)/2, ele_list)
print (price )

Solution (Python):
from sys import stdin

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

    v = sorted(V)
    l = len(v)
    while l > 1:
        n = (v[0] + v[1]) / 2
        v = sorted(v[2:] + [n])
        l -= 1
    print(*v)

input = lambda: stdin.readline()
main()

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

while(len(l)>1):
    l = sorted(l)
    tmp = (l[0] + l[1])/2
    l.append(tmp)
    l.pop(0)
    l.pop(0)

print(l[0])

Solution (Python):
n = int(input())
num_list = sorted(list(map(int, input().split())))
def merge(num_list):
    if len(num_list) == 1: 
        return num_list
    if len(num_list) ==2: 
        return [(num_list[0] + num_list[1])/2]
    else:
        tmp = num_list[2:]
        tmp.append((num_list[0] + num_list[1])/2)
        return tmp

for i in range(n-1):
    num_list = sorted(merge(num_list))
print(num_list[0])

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

v = sorted(v)

def dfs (l):
    if len(l)==1:
         return l[0]
    num = (l[0]+l[1])/2.0
    l = l[2:]
    
    l.append(num)
    
    l = sorted(l)
    return dfs(l)



print(dfs(v))

Solution (Python):
N=int(input())
V=sorted(list(map(int,input().split())))
while True:
  try:
    V[0]=(V[0]+V[1])/2
    V.pop(1)
  except:
    break
print(V[0])

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

for i in range(n-1):
    v.sort()
    a = v.pop(0)
    b = v.pop(0)
    c = (a+b)/2
    v.append(c)

print(v[0])

Solution (Python):
from heapq import heappush, heappop

N = int(input())
vLst = list(map(int, input().split()))
v = []
for i in range(N):
    heappush(v, vLst[i])

ans = 0
for i in range(N - 1):
    tmp1 = heappop(v)
    tmp2 = heappop(v)
    ans = float((tmp1 + tmp2) / 2)
    heappush(v, ans)

print(v[0])

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

v.sort()

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

Solution (Python):
N = int(input())
A = [int(s) for s in input().split()]

A.sort()
tmp = (A[0] + A[1])/2
if N >= 3:
  for i in range(2, N):
    tmp = (tmp + A[i])/2

print(tmp)

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

from heapq import heappush, heappop, heapify

heapify(v_list)

while len(v_list) > 1:
    x = heappop(v_list)
    y = heappop(v_list)
    heappush(v_list, (x + y) / 2)

print(v_list[0])

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

ans = 0

for i in range(n - 1):
  x = v.pop(v.index(min(v)))
  y = v.pop(v.index(min(v)))

  ans = (x + y) / 2 
  v.append(ans)

print(ans)

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

Solution (Python):
import heapq

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


heapq.heapify(V)

while len(V) > 1:
  e1 = heapq.heappop(V)
  e2 = heapq.heappop(V)
  heapq.heappush(V, (e1+e2)/2.)

print(V[0])

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):
a = list(open(0))

for i in a:
    s = i.replace('\n','')
    ss = s.split(' ')

txt = []
for i in ss:
    txt.append(int(i))
txt = sorted(txt)

res = 0
for j in range(len(txt))[:-1]:
    if j == 0:
        res += (txt[j] + txt[j+1]) / 2
    else:
        res = (res + txt[j+1]) / 2
print(res)

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

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

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

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

Solution (Python):
n = int(input())
vs = list(map(int, input().split()))
def mmm(vs):
    minimum = 10000
    for v in vs:
        if v < minimum:
            minimum = v
    vs.remove(minimum)
    return minimum

for i in range(len(vs)-1):
    m1 = mmm(vs)
    m2 = mmm(vs)
    vs.append((m1+m2)/2)

print(vs[0])

Solution (Python):
if __name__ == '__main__':
    n = int(input())
    v = list(map(int,input().split()))
    v.sort()
    for i in range(n-1):
        a = v.pop(0)
        b = v.pop(0)
        v.insert(0, (a+b)/2)
    print(v[0])

Solution (Python):
from functools import reduce

def aaa(x, y):
    return (x + y) / 2

N = int(input())
L = list(map(int, input().split()))
L.sort()
ans = reduce(aaa, L)
print(ans)

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

n_list.sort()

new_list = []
ctr = 0

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

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

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

b = sorted(a)
for i in range(0,n-1):
    if i == n-1:
        break
    tmp = (b.pop(0)+b.pop(0))/2
    b.insert(0,tmp)

print(b[0])

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

for i in range(n-1):
      x = a_lis[0]
      y = a_lis[1]
      z = (x+y)/2
      del a_lis[:2]
      a_lis.insert(0,z)
print(a_lis[0])

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

s += v[0]*(2**-n)
for i in range(n):
    s += v.pop()*(2**-(i+1))

print(s)

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

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

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

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

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

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

Solution (Python):

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

new_v = sorted(v)

for i in range(N-1):
    if i == 0 :
        a = (new_v[i]+new_v[i+1])/2
    else:
        a = (a + new_v[i+1])/2
print(a)

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

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

Solution (Python):
from fractions import Fraction


def main():

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

    while(len(elements)!=1):
        left = elements.pop(0)
        right = elements.pop(0)
        newElement = (left+right)/2
        elements.append(newElement)
        elements.sort()
    print(elements[0])



if __name__== "__main__":
    main()

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

print(ans)

Solution (Python):
from decimal import Decimal, ROUND_HALF_UP, ROUND_HALF_EVEN
N = int(input())
a = list(map(int, input().split()))
a = sorted(a)

a1 = a.pop(0)
a2 = a.pop(0)
res = Decimal((a1 + a2) / 2)

for i in range(N - 2):
    res = Decimal((a[i] + res) / 2)

print(res)

Solution (Python):
import sys

N = int(input())

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

sum = 0
while v:
    if len(v)==1:
        print(v[0])
        sys.exit()
    s = (v.pop(-1) + v.pop(-1)) / 2
    v.append(s)
    v.sort(reverse=True)

Solution (Python):


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

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

print(s)

Solution (Python):

def alchemy(x, y):
    val = (x+y)/2
    return val

if __name__ == "__main__":
    n = int(input())
    v = list(map(int, input().split()))
    ans = 0

    for i in range(n-1):
        v = sorted(v)
        new_item = alchemy(v[0], v[1])
        del v[0:2]
        v.append(new_item)
        

    print(v[0])

Solution (Python):
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())
vlist = list(map(int,input().split()))
vlist.sort()
ans = 0
a = len(vlist)-1
for _ in range(a):
    vlist.append((vlist[0]+vlist[1])/2)
    del vlist[0:2]
    vlist.sort()
print(vlist[0])

Solution (Python):
import heapq

n = int(input())
hp = []
d = 1 << (n - 1)
for v in (d * int(s) for s in input().split()):
    heapq.heappush(hp, v)
for i in range(n - 1):
    x = heapq.heappop(hp)
    y = heapq.heappop(hp)
    
    heapq.heappush(hp, (x + y) / 2)
print('%.6f' % (hp[0] / d))

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

if __name__ == '__main__':
  main()

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

for i in range(1, N - 1):
    left = v.pop(v.index(min(v)))
    right = v.pop(v.index(min(v)))
    v.append((left + right) / 2)
    
print((v[0] + v[1]) / 2)

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

for _ in range(n-1):
    val=v.pop(0)
    v[0]=(v[0]+val)/2

print(v[0])

Solution (Python):
n = int(input())
numbers = list(map(int,input().split()))
 
def aaa(numbers):
    if len(numbers) > 1:
        numbers.sort()
        new_number = (numbers[0] + numbers[1]) / 2
        n_0 = numbers[0]
        n_1 = numbers[1]
        numbers.remove(n_0)
        numbers.remove(n_1)
        numbers.append(new_number)
        aaa(numbers)
    else:
        return numbers[0]
      
aaa(numbers)
print(aaa(numbers))

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

v = input().split()

v = [float(i) for i in v]
v.sort()

for i in range(N - 1):
  min1 = v[0]
  min2 = v[1]
  tmp = (min1 + min2) / 2.0
  v.pop(0)
  v.pop(0)
  v.insert(0, tmp)
print(*v)

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

Solution (Python):
n = int(input())
s = str(input())
v_s = s.split()
v_s = [float(str) for str in v_s]
v_s.sort()

idx = 0
while idx < n-1:
  v0 = v_s.pop(0)
  v1 = v_s.pop(0)
  v_s.insert(0, (v0 + v1)/2.0)
  idx += 1

print(v_s.pop(0))

Solution (Python):
import numpy as np

N = int(input())
v = np.array(input().split(' '), float)

v = np.sort(v)

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

print(value)

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

if N == 2:
    print((A[0]+A[1])/2)

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

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

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

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

Solution (Python):
import heapq

def solve(n, v):
    v_pq = []
    for v_i in v:
        heapq.heappush(v_pq, v_i)

    while len(v_pq) > 1:
        v1 = heapq.heappop(v_pq)
        v2 = heapq.heappop(v_pq)
        heapq.heappush(v_pq, (v1 + v2) / 2)

    return heapq.heappop(v_pq)


if __name__ == "__main__":
    n = int(input())
    v = list(map(int, input().strip().split(" ")))
    print(solve(n, v))

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

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


def sumnum(v):
    v.sort(reverse=True)
    a=v.pop()
    b=v.pop()
    v.append((a+b)/2)

for i in range(n-1):
    sumnum(v)
print(v[0])

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

sort_list = sorted(list_a)

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

print(tmp)

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




sorted_values = sorted(values)


anser_values = [0.0 for _ in range(N)]
anser_values[0] = (sorted_values[0] + sorted_values[1]) / 2
for n in range(2, N):
    anser_values[n - 1] = (anser_values[n - 2] + sorted_values[n]) / 2

print(anser_values[N - 2])

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

v.sort()
for j in range(n-1):
    new_v = (v.pop(0) + v.pop(0)) / 2
    v.append(new_v)
    v.sort()
print(*v)

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

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

while True:
    v.sort(reverse=True)
    v.append((v.pop() + v.pop()) / 2)
    if len(v) == 1:
        break

print(v[0])

Solution (Python):
def calc(x, y):
    return (x + y) / 2


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

    for _ in range(N - 1):
        V.sort()
        V.append(calc(V.pop(0), V.pop(0)))

    print(V.pop(0))

    return


if __name__ == "__main__":
    main()

Solution (Python):
import numpy as np

n = int(input())
a = [float(i) for i in input().split()]
a = np.sort(np.array(a))


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

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

Solution (Python):
N = int(input())
v_array = [int(i) for i in input().split()]

for i in range(N-1):
    now_min = v_array[i]
    min_index = i
    for j in range(i+1,N):
        if v_array[j] < now_min:
            min_index = j
            now_min = v_array[j]
    if min_index != i:
        v_array.pop(min_index)
        v_array.insert(min_index,v_array[i])
        v_array.pop(i)
        v_array.insert(i, now_min)

synthesis = v_array[0]

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

print(synthesis)

Solution (Python):
import sys


def main():
    n = int(sys.stdin.readline().strip())
    v = [int(s) for s in sys.stdin.readline().strip().split()]

    v.sort()

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


main()

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

new_vvv = vvv
for _ in range(N - 1):
    merged = sum(new_vvv[:2]) / 2
    new_vvv = [merged] + new_vvv[2:]
    new_vvv.sort()

print(new_vvv[0])

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

for i in range(N-1):
    v_i = sorted(v_i)
    temp = (v_i[0] + v_i[1]) / 2
    del v_i[0]
    del v_i[0]
    v_i.append(temp)

print(v_i[0])

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

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

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

Solution (Python):
n = int(input())
a = [float(x) for x in input().split(' ')]
a.sort()
x = a[0]
for i in range(1, len(a)):
  x = (x + a[i])/2.0
  
print(x)

Solution (Python):
N = int(input())
li = list(map(int,input().split()))
li.sort()
k = 0
while len(li) >1:
    k = (li[0] + li[1]) / 2
    del li[1]
    del li[0]
    li.insert(0,k)
print('{:.10g}'.format(li[0]))

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

while len(v) >= 2:
    a = (v.pop(0) + v.pop(0))/2
    v.append(a)
    v.sort()

print(v[0])

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

V.sort(reverse=True)

ans = 0
for i, v in enumerate(V):
    if i == len(V) - 1:
        ans += v / (2 ** i)
    else:
        ans += v / (2 ** (i + 1))

print(ans)

Solution (Python):
n=int(input())
v=list(map(int, input().split()))
for i in range(n-1):
    v.sort(reverse=True)
    a=v.pop()
    b=v.pop()
    v.append((a+b)/2)
print(v.pop())

Solution (Python):
while True:
    try:
        N = int(input())
        A = list(map(int, input().split()))
        A.sort()
        result = None
        for i in A:
            if result is None:
                result = i
                continue
            result += i
            result = result / 2
        print(result)
    except EOFError:
        break

Solution (Python):
import sys
p = [r for r in sys.stdin.read().split('\n') if r != '']
n = int(p[0])
a = [int(c) for c in p[1].split()]
a.sort()
x = 1
t = 0
for i in reversed(a[1:]):
    t += i / x
    x *= 2
print(t / 2 + a[0] / x)

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

s = v[0] + v[1]
for n in range(2, N):
    s += 2 ** (n - 1) * v[n]
s /= 2 ** (N - 1)

print(s)

Solution (Python):

n = int(input())
v = [int(i) for i in input().split()]
v.sort()
v1 = v.pop(0)
for i in range(n-1): 
  v2 = v.pop(0)
  v1 = (v1 + v2) / 2
print(v1)

Solution (Python):
import numpy as np

n = int(input())
v = np.array(list(map(int,input().split())))
v_sort = np.sort(v)
temp = 0

for index in range(n-1):
  temp = (v_sort[0]+v_sort[1])/2
  v_sort = np.delete(v_sort,0)
  v_sort = np.delete(v_sort,0)
  v_sort = np.append(v_sort,temp)
  v_sort = np.sort(v_sort)

print(v_sort[0])