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

Solution (Python):




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

nums.sort()
ans = 0
for i in range(n):
    ans += nums[i]
    if i > 0:
        ans = ans / 2.0

print(ans)

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

while len(v) != 1:
    new_v = (v[0] + v[1]) / 2
    del v[0]
    del v[0]
    v.append(new_v)
    v.sort()
print(v[0])

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

for i in range(n-1):
    a, b = v.pop(), v.pop()
    v.append((a+b)/2)
    v = sorted(v, reverse=True)

print(*v)

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

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v.sort(reverse=False)
ans = []
ans.append(v[0])

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

print(ans[-1])

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

v.sort()

ans = v.pop(0)
for i in v:
    ans = (ans + i)/2

print(ans)

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

sorted_v = sorted(vlist)

price = 0
for v in sorted_v:
    if price == 0:
        price = v
    else:
        price = (price + v)/2
        
print(price)

Solution (Python):
n = int(input())
values = sorted(map(float, input().split()), reverse=True)

while len(values) >= 2:
    a = values.pop()
    b = values.pop()
    values.append((a + b) / 2)

print(values.pop())

Solution (Python):

N = input()
V = list(map(int, input().split()))
V = sorted(V)
value = V.pop(0)
while V:
    value =(value + V.pop(0))/2
print(value)

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

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

v.sort()

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

print((first+v[n-1])/2)

Solution (Python):
n = input()
a = map(float, raw_input().split())

a.sort()

while len(a) != 1:
  x = a.pop(0)
  y = a.pop(0)
  a.append((x + y) / 2)
  a.sort()

print a[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())
values = sorted([int(x) for x in input().split()])

combined_value = values[0]
sliced_values = values[1:]
for value in sliced_values:
  combined_value = (combined_value + value) / 2

print(round(combined_value, 5))

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

list.sort(reverse = True)

while(len(list) > 1):
    vj = list.pop()
    vi = list.pop()
    vk = (vi + vj)/2
    list.append(vk)
    list.sort(reverse = True)

print(list[0])

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

v.sort()

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

print(v[N-1])

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

Solution (Python):
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)


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

v_list = np.array(v_list)


for i in range(n):
	v_list[i] = v_list[i] / (2**(n-i))
v_list[0] = v_list[0] * 2

print((np.sum(v_list)))

Solution (Python):


input()
ingredients = list(map(float, input().split()))

ingredients.sort()


while True:
    first = ingredients.pop(0)
    second = ingredients.pop(0)
    
    new_ingredient = (first + second) / 2
    ingredients.insert(0, new_ingredient)
    if len(ingredients) == 1:
        break

print(ingredients[0])

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

Solution (Python):
import math
import numpy as np

















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

v = a[0]

for i in a:
    v = (v + i)/2

print(v)

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

for i in range(n-1):
  min1 = min(v)
  v.remove(min1)
  min2 = min(v)
  v.remove(min2)
  v.append((min1+min2)/2)

print(v[0])

Solution (Python):


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

v.sort(reverse=True)

while(True):
    
    if(len(v) <= 1):
        break
    
    a = v.pop()
    b = v.pop()
    v.append((a+b)/2)

print(v[0])

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
V.sort()
x = (V[0]+V[1])/2

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

print(x)

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

vc = sorted(v)

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

print(vc[n-1])

Solution (Python):
import numpy as np

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

v.sort()
v = np.array(v)
c = np.array([1] + [2**i for i in range(N-1)])

print(np.sum(v * c) / 2**(N-1))

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

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


total_value = 0
for i in range(1,N):
    if i != 1:
        total_value += A[i]/pow(2, N-i)
    else:
        total_value += (A[0]+A[1])/pow(2, N-1)
    
print(total_value)

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

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

vs.sort(reverse=True)

def solve(v):
    if len(v) > 2:
        ans = v[0]/2 + solve(v[1:])/2
    else:
        ans = sum(v)/2
    return ans

print(solve(vs))

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

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

ans = 0
for i in range(N):
    if i == 0:
        ans = V[i]
    else:
        ans = (ans + V[i]) / 2
print(ans)

Solution (Python):
from functools import reduce
from decimal import Decimal

cnt = int(raw_input())
materials = [Decimal(str(m)) for m in raw_input().split()]
materials = sorted(materials)
total = reduce(lambda x, y: (x + y) / 2, materials)
print float(total)

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

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

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

L.sort()

for i in range(N-1):

    new = L[0] + L[1]
    new /= 2
    
    L = L[2:]
    L.append(new)
    L.sort()

print('{:.6f}'.format(L[0]))

Solution (Python):
def sort_index(a):
    for i in range(len(a)):
        for j in range(i + 1, len(a)):
            if a[i] > a[j]:
                a[i], a[j] = a[j], a[i]
    return a


def get_answer(n, a):
    n = int(n)
    a = [int(v) for v in a.split(" ")]
    a = sort_index(a)
    v_max = 0
    v = a[0]
    for i in range(1, len(a)):
        v = (v + a[i]) / 2
    if v > v_max:
        v_max = v
    return v_max



if __name__ == "__main__":
    input1 = input()
    input2 = input()
    print(get_answer(input1, input2))

Solution (Python):
n=int(input())
v=sorted([int(i) for i in input().split()])
while len(v)>1:
    res=v[0]+v[1]
    v=v[2:]
    v.append(res/2)
    v.sort()
print(v[0])

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

Vi.sort()

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

print(answer)

Solution (Python):
import io
import sys

MOD = 10 ** 9 + 7


def IN_S():
  return input()


def IN_I():
  return int(input())


def IN_L_I():
  return list(map(int, input().split()))


def IN_L_S():
  return list(map(str, input().split()))


def STR_SPLIT(s, n):
  for l in range(0, len(s), n):
    yield s[0 + l:n + l]


def T_IN():
  global test_str
  sys.stdin = io.StringIO(test_str[1:-1])


test_str = '''
3
500 300 200
'''


def MAIN():
  
  A()


def A():
  n = IN_I()
  nums = IN_L_I()
  nums.sort()
  t = nums.pop(0)

  for num in nums:
    t = (t + num) / 2

  print(t)

  return None


def B():
  return None


def C():
  return None


MAIN()

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

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

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

print(sum(v))

Solution (Python):
def main():
    N = input()
    in_value = [float(i) for i in input().split(' ')]

    sort_value = sorted(in_value)

    if(N != 1):
        while(len(sort_value) != 1):
            sort_value = [(sort_value.pop(0) + sort_value.pop(0)) / 2] + sort_value
                       
    print(sort_value[0])


if __name__ == "__main__":
    main()

Solution (Python):
def main():
    N = input()
    in_value = [float(i) for i in input().split(' ')]

    sort_value = sorted(in_value)

    if(N != 1):
        while(len(sort_value) != 1):
            min_avg = (sort_value.pop(0) + sort_value.pop(0)) / 2
            sort_value.append(min_avg)
            sort_value = sorted(sort_value)

    print(sort_value[0])


if __name__ == "__main__":
    main()

Solution (Python):
n = int(input())
nums = sorted(map(lambda x: int(x), input().split(' ')))
res = nums[0] / 2**n
for index, num in enumerate(nums):
    res += num / 2**(n - index)
print(res)

Solution (Python):
n = int(input())
nums = sorted(map(lambda x: int(x), input().split(' ')))
res = nums[0] / 2**n
for index, num in enumerate(nums):
    res += num / 2**(n - index)
print(res)

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

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

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

if ans == int(ans):
    print(int(ans))
else:
    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, N):
    ans = (ans + v[i])/2
print(ans)

Solution (Python):
import heapq


def main():
    _ = input()
    v = [int(x) for x in input().split()]
    heapq.heapify(v)

    while len(v) >= 2:
        x = heapq.heappop(v)
        y = heapq.heappop(v)
        z = (x+y)/2
        heapq.heappush(v, z)
    print(v[0])


if __name__ == '__main__':
    main()

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

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

import heapq

heapq.heapify(V)

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

print(V[0])

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

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

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

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, len(v)):
    ans = (ans + v[i]) / 2
print(ans)

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, len(v)):
    ans = (ans + v[i]) / 2
print(ans)

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

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

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

V.sort()


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

print(V[N-1])

Solution (Python):











import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log 
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N=I()
    V=LI()
    ans = 0
    for i in range(N-1):
        V.sort()
        V.append((V[0]+V[1])/2)
        V.remove(V[0])
        V.remove(V[0])
    print(*V)
            
if __name__ == '__main__':
    main()

Solution (Python):
N = int(input())
Vs = sorted(list(map(int, input().split())), reverse=True)

def mysorted(lst, value):
    i = 0
    for i in range(len(lst)):
        if lst[i] <= value:
            break
    res = lst[:i]
    res.append(value)
    res.extend(lst[i:])
    return res

for i in range(N-1):
    composed_item = (Vs[N-2-i] + Vs[N-1-i]) / 2
    Vs = mysorted(Vs[:N-2-i], composed_item)

print(Vs[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, len(V)):
    ans = (ans + V[i]) / 2
print(ans)

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

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

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

Solution (Python):
N = int(input())
v = list(map(int,input().split()))
v.sort()
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())
L = list(map(float, input().split()))

L.sort()

while True:
    a = L.pop(0)
    b = L.pop(0)
    tmp = (a + b) / 2
    L.append(tmp)
    L.sort()
    if len(L) == 1:
        print(tmp)
        break

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

v.sort()

while True:
    head = v.pop(0)
    next = v.pop(0)

    avg = (head + next) / 2

    if len(v) == 0:
        print(avg)
        break
    else:
        v.append(avg)
        v.sort()

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

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

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 itertools import *
import sys
import time










def read_array():
	N = int(input())
	A = map(float, raw_input().split())
	return A





vs = sorted(read_array())
print reduce(lambda x, y: (x+y)/2, vs)

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

Solution (Python):


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

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

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

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

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

print(V[0])

Solution (Python):
n = int(input())
numbers = input()
numArr = str.split(numbers)
numList = []
for str in numArr:
    numList.append(int(str))
numList.sort()
if len(numList) >= 2:
    sum = numList[0]
    for i in range(1, n):
        sum = (sum + numList[i])/2
    print(sum)
else:
    print('error')

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

numerator = vs[0] + vs[1]
for i in range(2, n):
    numerator += (2 ** (i - 1)) * vs[i]
denominator = 2 ** (n - 1)
print(1.0 * numerator / denominator)

Solution (Python):
num = int(input())
num_list = sorted(list(map(int,input().split())))
val = num_list[0]
num_list.pop(0)
for i in num_list:
    val = (val+i)/2
print(val)

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

sum = v.pop(0)
for i in v:
    sum += i
    sum = sum/2

print(sum)

Solution (Python):

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

v.sort()

for i in range(len(v)-1):
    g = (v[0] + v[1])/2
    del v[:2]
    v.insert(0, g)

print(v[0])

Solution (Python):
N = int(input())
Value = list(map(int,input().split()))
Value = sorted(Value)
Sum = Value[0]
for i in Value:
    Sum = (Sum+i)/2.0
print(Sum)

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

v.sort()

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

print(value)

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

while len(v) > 1:
    x = (v[0] + v[1]) / 2
    v.append(x)
    del v[:2]
    v = sorted(v)
print(v[0])

Solution (Python):
N = int(input())
v = list(map(int,input().split()))
s = 0.0
for i in range(N-1):
	t = (0.5)**(i+1)
	u = max(v)
	s = s + t*float(u)
	v.remove(u)

s = s + ((0.5)**(N-1))*v[0]

print(s)

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

v.sort()

ans = v[0]

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

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,n):
    ans = (ans+v[i])/2
print(ans)

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

V.sort(reverse=True)

for _ in range(n-1):
    v1 = V.pop(-1)
    v2 = V.pop(-1)
    v = (v1 + v2) / 2
    V.append(v)

print(V[0])

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

Solution (Python):
n = int(input())
v = sorted(list(map(int, input().split())), reverse=True)
t = v.pop()
while v:
  t = (t+v.pop())/2
print(t)

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

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

Solution (Python):
import heapq
v = []
n = int(input())
v_0 = list(map(int,input().split()))
for u in v_0:
    heapq.heappush(v,u)
max = heapq.heappop(v)*((1/2)**(n-1))
while v:
    max += heapq.heappop(v)*((1/2)**(n-1))
    n -= 1
print(max)

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

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

while len(v)>=2:
  v = sorted(v,reverse=True)
  v1 = v.pop()
  v2 = v.pop()
  v.append((v1+v2)/2)

print(*v)

Solution (Python):
import sys

if sys.platform =='ios':
    sys.stdin=open('input_file.txt')
    
N=int(input())
L=list(map(int,input().split()))

lists=sorted(L)

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

print(lists[0])

Solution (Python):
import functools
N = int(input())
v = list(map(int, input().split()))
v.sort()
fun = lambda a,b : (a+b)/2
print(functools.reduce(fun, v))

Solution (Python):
input()
M = sorted(list(map(int, input().split())))
D = M.pop(0)
for N in M:
  D = ((D + N) / 2)
print (D)

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

Solution (Python):

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

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

item.sort()
x = item[0]
for i in range(N-1):
    x = (item[i+1] + x)/2
    
print(x)

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

v_max = A[0]
for num in A[1:]:
  v_max = (v_max+num)/2
print(v_max)

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

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

ans = a_list[0]
for i in range(N-1):
    ans = (ans + a_list[i+1]) / 2.0
print(ans)

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

Solution (Python):
from functools import reduce

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

l.sort()
ans = reduce(lambda x,y: (x+y)/2,l)
print(ans)

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

Solution (Python):


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

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

print(v[0])

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

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

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

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

print(total)

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

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

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

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

Solution (Python):
import numpy as np

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

a.sort()
b = [0.5,0.5]
for i in range(n-2):
    b = list(map(lambda x: x*0.5, b)) + [0.5,]

print(sum(np.array(a)*np.array(b)))

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

ingredients.sort()

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

Solution (Python):
import numpy as np

n=int(input())
a=list(map(float,input().split()))
s=np.sort(a)

tmp=s[0]

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

print(tmp)

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

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

heapify(values)

while len(values) > 1:
  a = heappop(values)
  b = heappop(values)
  heappush(values, (a+b) / 2)
  
print(values[0])

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

v.sort()

ans = 0

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

print(ans)

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

while len(v_list) > 1:
    v_list.sort(reverse=True)
    v = (v_list[-2] + v_list[-1]) / 2
    v_list[-2] = v
    v_list.pop()
print(v_list[0])

Solution (Python):

import copy
import random
import bisect 
import fractions 
import math
import sys
import bisect

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

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())
v = LI()

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


print(pre)

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

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

for i in range(N-1):
  temp = (float(l[0])+float(l[1]))/2
  del l[:2]
  l.insert(1, temp)

print(temp)

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

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

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

Solution (Python):
num=int(input())
array = list(map(int, input().strip().split()))
la=array.sort()

wa=0
for i in range(1,num):
    if i==1:
        wa=(array[i-1]+array[i])/2
    else:
        wa=(wa+array[i])/2
print(wa)

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

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

for i in range(n):
    for j in range(i+1,n):
        if v[i]>v[j]:
            a=v[i]
            v[i]=v[j]
            v[j]=a
for l in range(n-1):
    v2=[]
    a=(v[0]+v[1])/2
    v2.append(a)
    v2=v2+v[2:n]
    v=v2
print(v[0])

Solution (Python):


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

v.sort()

ans = 0 

ans=v.pop(0)

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

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

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

res = v[0]

for x in v[1:]:
    res += x
    res /= 2

print(res)

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

V.sort()
x = V.pop(0)
for v in V:
  x = (x + v) / 2.0
print(x)

Solution (Python):
def solve():
    N = int(input())
    v = sorted(map(int, input().split()))
    
    while len(v) > 1:
        v.insert(0, (v.pop(0)+v.pop(0))/2.0)
        
    print(v.pop())
    
solve()

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

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

v.sort()

res = v[0]

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

print(res)

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

while True:
    v = sorted(v)
    if len(v) >= 2:
        a = (v[0] + v[1]) / 2
        v[1] = a
        v = v[1::]
    else:
        break
print(v[0])

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

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

v_sort = sorted(v)
a=v_sort[0]

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

Solution (Python):
import heapq

def solve(n, v):
    q = []
    for i in range(n):
        heapq.heappush(q, v[i])
    for i in range(n-1):
        x = heapq.heappop(q)
        y = heapq.heappop(q)
        heapq.heappush(q, (x+y)/2)
    return heapq.heappop(q)

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

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

while i < n and len(v) >= 2:
	v.sort()
	f = v.pop(0)
	s = v.pop(0)
	ans = (s+f)/2
	v.append(ans)
	i += 1

print(ans)

Solution (Python):
input()
s=list(map(int, input().split()))
s.sort()
res=0
for i in s:
  if res  == 0:
    res = i
    continue
  res=(res+i)/2
print(res)