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

res = 0

for i, v in enumerate(vals, 1):
    if i < N:
        res = res + v / 2 ** i
    else:
        res = res + v / 2 ** (N - 1)

print(res)

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

n.sort()

sum1 = n[0]

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

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

list.sort()
ans=(list[0]+list[1])/2

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

print(ans)

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

v.sort()

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

Solution (Python):
import numpy as np
N = int(input())
V = np.array([int(v) for v in input().split()])
Vs = np.sort(V)
v = (Vs[0] + Vs[1]) / 2.0
for i in range(2, len(Vs - 1)):
    v = (v + Vs[i]) / 2.0
print(v)

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

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

bb = input()
b = []
for i in bb.split(' '):
    b.append(int(i))

b.sort()
aa = b[0]
for i in range(1, len(b)):
    bb = b[i]
    aa = (aa + bb) / 2

print(aa)

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

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


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

print("{:.5f}".format(w))

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

while len(v) > 1:
    min1 = min(v)
    v.remove(min(v))
    min2 = min(v)
    v.remove(min(v))
    avg = (min1 + min2) / 2
    v.append(avg)

print(sum(v))

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

v_list = sorted(v_list)

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

print(total)

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

ans = 0
V.sort()

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

print(tmp)

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

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

Solution (Python):
import math
import sys
import queue
from collections import Counter
from itertools import accumulate
from fractions import gcd
from functools import reduce


def lcm(a, b):
    return a * b // gcd(a, b)

def combination_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

def permutations_count(n, r):
    return math.factorial(n) // math.factorial(n - r)

sys.setrecursionlimit(10000)

mod = 1000000007

"""

a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 



    = sys.stdin.readline().rstrip()
    = list(sys.stdin.readline().rstrip())


    = int(sys.stdin.readline())
    = map(int, sys.stdin.readline().split())
    = list(map(int, sys.stdin.readline().split()))
    = [list(map(int,list(sys.stdin.readline().split()))) for i in range(N)]
"""

if __name__ == "__main__":
    n= int(sys.stdin.readline())
    v= list(map(int, sys.stdin.readline().split()))
    v.sort()
    if n ==2:
        print((v[1]+v[0])/2)
    else:
        tmp=v[0]
        for i in range(n-2):
            tmp = (tmp+v[i+1])/2
        ans = (tmp+v[n-1])/2
        print(ans)

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

v.sort()

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

Solution (Python):


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

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[0])

Solution (Python):


import sys

debug = False

def log(text):
    if debug:
        print(text)

def parse_input(lines_as_string = None):

    global debug
    lines = []
    if lines_as_string is None:
        debug = False
        lines.append(input())
        lines.append(input())
    else:
        debug = True
        lines = [e for e in lines_as_string.split("\n")][1:-1]

    n = int(lines[0])
    v = [int(e) for e in lines[1].split(" ")]

    return (n, v)


def solve(n, v):

    v.sort()

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

    return total


def main():
    

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()

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

v.sort()

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

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

print(u[0])

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

Solution (Python):
n = int(input())
v = sorted(list(map(int, input().split())), reverse=True)
ans = 0
for i, j in enumerate(v):
  if i!=len(v)-1:
    ans += j/(2**(i+1))
  else:
    ans += j/(2**(i))
print(ans)

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

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

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

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

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

v.sort()

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

Solution (Python):
n = int(input())
li = list(map(int,input().split()))
sorted_li = sorted(li)
new_li = []
for i in range(n):
    if i == 0:
        new_li.append(sorted_li[0]/(2**(n-1)))
    else:
        new_li.append(sorted_li[i]/(2**(n-i)))
print(sum(new_li))

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

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

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

print(ans)

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

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

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

print(sum)

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

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

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


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

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

V_asc = sorted(V)

mix_v = V_asc[0]
for v in V_asc[1:]:
    mix_v = (mix_v + v) / 2

print(mix_v)

Solution (Python):


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

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

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

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

print(v_1[0])

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

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

print(tmp.pop())

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

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

v.sort()

sum = (v[0] + v[1])/2;

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

print(str(sum))

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

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

A = sorted(A)
buf = A[0]
for a in A[1:]:
    buf = (buf+a)/2
print(buf)

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

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

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

print(v[n-1])

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


fact = nums[0]
for i in range(len(nums)):
    fact = (fact + nums[i]) / 2


print(fact)

Solution (Python):

n = int(input())
materials = list(map(int,input().split()))
materials.sort()
value = materials[0]

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

print(value)

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

Solution (Python):
N = int(input())
v = map(int,input().split())
v = sorted(v,reverse=True)
l = [v[i]*1/2**(i+1) for i in range(N-1)]
l.append(v[-1]/2**(N-1))
print(sum(l))

Solution (Python):
n = int(input())
vs = list(map(int,input().split()))
vs.sort()
ans = vs.pop(0)
for i in range(n-1):
    ne = vs.pop(0)
    ans = (ans + ne) /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):
n=int(input())
v=list(map(int,input().split()))
v.sort(reverse=True)
while len(v)>=2:
	v.append(round((v.pop()+v.pop())/2,7))
print(v.pop())

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

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

print(pot)

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

Solution (Python):


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

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

new = 0
while len(vlist) > 1:
  new = (vlist.pop(0) + vlist.pop(0))/2
  vlist.insert(0,new)

print(vlist.pop())

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

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

Solution (Python):
n = int(input())
lst = list(map(lambda x:int(x), input().split()))

lst.sort()

heikin = lst[0]
for i in range(n):
    if i == 0:
        pass
    else:
        heikin = (heikin+lst[i])/2.0

print(heikin)

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

def f(v):
        v0 = v.pop(0)
        v1 = v.pop(0)
        v.append((v0+v1)/2)
        v.sort()
        
        if len(v) == 1:
                print(v[0])
                exit()
        else:
                f(v)

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

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

sv = sorted(v)
tmp = (sv[0]+sv[1])/2

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

Solution (Python):
import numpy as np

def set_list(es):
    return len(list(set(es))) == 1

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

if(len(a)==2):
    print((a[0]+a[1])/2)    
elif(len(a)!=2 and set_list(a)):
    print(a[0])
else:
    for i in range(1,n):
        idx = np.argmin(a)
        num1 = a.pop(idx)
        idx = np.argmin(a)
        num2 = a.pop(idx)
        a.append((num1+num2)/2)
    print(a[0])

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

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

print(l[N-1])

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

v_list.sort(reverse=True)
v_list[-2] += v_list[-1]
v_list.pop(-1)

cnt = 1
ans = 0
for v in v_list:
    ans += v/(2**cnt)
    cnt += 1
    
print(ans)

Solution (Python):
import heapq

N = int(input())
Vs = list(map(int, input().split(" ")))

heapq.heapify(Vs)

for _ in range(N-1):
    tmp = (heapq.heappop(Vs) + heapq.heappop(Vs))/2
    heapq.heappush(Vs, tmp)
    
print(heapq.heappop(Vs))

Solution (Python):
def main():
    N = int(input())
    vs = [int(x) for x in input().split()]
    while len(vs) > 1:
        vs = sorted(vs)
        x , y = vs[0], vs[1]
        vs[1] = (x + y) / 2
        vs.pop(0)
    print(vs[0])
    return


if __name__ == "__main__":
    main()

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

for i in range(n):
	v[i] = int(v[i])

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())
Vn = list(map(int,input().split(' ')))
heapq.heapify(Vn)
init_val = heapq.heappop(Vn) 

for _ in range(N -1):
    init_val = (init_val + heapq.heappop(Vn))/2
print(init_val)

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

V.sort()

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

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

Solution (Python):



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

vn.sort()

sum = (vn[0] + vn[1]) / 2
for i in range(2, N):
    sum = (sum + vn[i]) / 2
print(sum)

Solution (Python):
import sys
from collections import deque
import heapq
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()
a.sort(reverse=True)

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

print(a[-1])

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

Solution (Python):
N = int(input())
V = list(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()
i = 1
A = V[0]
naga = len(V)
while i < naga:
    A=(A+V[i])/2
    i += 1
print(A)

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

Solution (Python):
from bisect import insort_left

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

for _ in range(n - 1):
    if len(values) < 2:
        break
    x = values.pop(0)
    y = values.pop(0)
    new_value = (x + y) / 2.0
    insort_left(values, new_value)

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

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

while len(vlist) != 1:
    min1 = min(vlist)
    vlist.remove(min1)
    min2 = min(vlist)
    vlist.remove(min2)
    app = (min1+min2)/2
    vlist.append(app)

print(vlist[0])

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

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

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

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

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

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

Solution (Python):
import numpy as np
import sys

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

    a.sort()
    ret = (a[0] + a[1])/2

    for i in range(2, len(a)):
        ret = (ret+a[i])/2
    

    
    print(ret)
        


if __name__ == '__main__':
    main()

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

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

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

V.sort()


while not len(V) == 1:
    temp = (V[0] + V[1]) / 2
    del V[1]
    V[0] = temp

print(V[0])

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

s.sort()

i=1
result=s[0]

while i<len(s):
  result=(result+s[i])/2
  
  i=i+1

print(result)

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

V.sort()
gousei = 0

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

print(gousei)

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

Solution (Python):


n = int(input())

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


v.sort(reverse=False)


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

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

print(str(result))

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

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

Solution (Python):

from collections import defaultdict
from collections import deque
from heapq import heappush, heappop, heapify
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
v = LI()

heapify(v)

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

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

v = sorted(v)

ans = 0

for i in range(n):
    if i == 0 or i == 1:
        mo = 2**(n-1)
    else:
        mo = 2**(n-i)
    ans += v[i]/mo

print(ans)

Solution (Python):
import numpy as np

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

a = np.array(a)
a.sort()

s = a[0]
for x in a:
  s = (s + x)/2
print(s)

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

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

print(a[0])

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

while len(V) > 1:
    x_ind = V.index(min(V))
    x = V.pop(x_ind)
    y_ind = V.index(min(V))
    y = V.pop(y_ind)
    V.append((x + y)/2)

print(V[0])

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

array = list(map(int, input().strip().split(' ')))
array.sort()

s = (array[0] + array[1] )/2
for i in range(n-2):
    m = (s + array[i+2])/2
    s = m
print(s)

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

List.sort()

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

print(Answer)

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

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
v.sort()
v.append(0)
ave = (v[0] + v[1]) / 2
for x in v[2:]:
    if x == 0:
        break
    else:
        ave = (ave + x) / 2
print(ave)

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

while len(l)!=1:
	l.sort()
	
	x = (l[1] + l[0])/2
	if len(l)==2:
		print(x)
		exit()
	l.pop(1)
	l.pop(0)
	l.append(x)

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().rstrip().split(' ')))
V.sort(reverse=True)

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

Solution (Python):
N = int(input())
v_list = list(map(lambda x:int(x),input().split(" ")))

while len(v_list) > 1:
  min_1 = min(v_list)
  v_list.remove(min_1)
  min_2 = min(v_list)
  v_list.remove(min_2)
  new_value = (min_1 + min_2)/2
  v_list.append(new_value)

print(v_list[0])

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

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

v.sort()
for i in range(100):
    if len(v) <= 1:
        break
    a = (v[0] + v[1]) / 2
    v = [a] + v[2:]
    v.sort()

print(*v)

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())
vl = sorted( map(int, input().split()) )
ans = vl[0] / (2**(len(vl)-1))
for i in range(len(vl)-1):
    ans += (vl[i+1] / (2**(len(vl)-1-i)))

print(ans)

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

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

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

v.sort()

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

print(v[n-1])

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

Solution (Python):


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

    x = V[0]

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

    print('{:.6f}'.format(x))
    

if __name__ == '__main__':
    main()

Solution (Python):
import numpy as np    
N = int(input())
vstr = input().split()
vs = [int(v) for v in vstr]

for i in range(N-1):
    valarg = np.argmin(vs)
    val1 = vs.pop(valarg)
    valarg = np.argmin(vs)
    val2 = vs.pop(valarg)
    vs.append((val1+val2)/2)
    if len(vs) == 1:
        break
print(vs[0])

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

V = sorted(V)

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

print(V[-1])

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

A.sort()
stock = 0
count = 0

for i in A:
    if count == 0:
        stock = i
        count += 1
    else:
        stock = (stock + i)/2
    
print(stock)

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

v.sort(reverse=True)

ans = 0

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

print(ans)

Solution (Python):
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *

N = int(input())
q = list(map(int, input().split()))
heapify(q)
while len(q) > 1:
    a, b = heappop(q), heappop(q)
    heappush(q, (a+b)*0.5)
print(q[0])

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


if __name__ == '__main__':
    main()

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

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

V = sorted(V)

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

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

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

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

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

print(ans)

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


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

print(V[N-1])

Solution (Python):

N  = int(input())
v = [int(i) for i in input().split()]
s = 0

for i in range(N-1):
  a = min(v)
  v.remove(a)
  b = min(v)
  v.remove(b)
  s = (a + b)/2
  v.append(s)
  

print(s)

Solution (Python):
from heapq import heapify,heapreplace,heappop
N=int(input())
A=list(map(int,input().split()))
A=[a for a in A]
heapify(A)
while len(A)>1:
    t = heappop(A)
    heapreplace(A,(t+A[0])/2)
print(A[0])

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

a.sort()
s = a[0]

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

print(s)

Solution (Python):
N = int(input())
goods = list(map(int, input().split()))
if N == 2:
    print(sum(goods)/2)
else:
    while len(goods) > 2:
        goods = sorted(goods)
        a = goods.pop(0)
        b = goods.pop(0)
        goods.append((a+b)/2)
    print(sum(goods)/2)

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

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

print(ans)

Solution (Python):
N = int(input())
v_list = list(map(int, input().split()))
v_list = sorted(v_list)
sum = 0

for v,i in zip(v_list, range(1, N+1)):
  if i < 3:
    sum += v
  else:
    sum += (2**(i - 2)) * v
print(sum/(2**(i-1)))

Solution (Python):
input()
v = sorted(map(int, input().split()))
r = v[0]
for x in v:
    r = (r + x) / 2
print(r)

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

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

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

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

print(sum)

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

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

low = 0
while len(lst) > 1:
  lst.sort(reverse=True)
  x = lst.pop()
  y = lst.pop()
  lst.append((x+y) / 2)
print(lst[0])

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

sv = sorted(v)
z = sv[0]
for s in sv[1:]:
    z = (z + s) / 2

print(z)

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

Solution (Python):
n=int(input())
ls=list(map(int,input().split()))
ls.sort()
init=ls.pop(0)
ans=0
for i in ls:
    ans=(init+i)/2
    init=ans
print(ans)