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

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

u = sorted(u)
ans = 0

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

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

v.sort()

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

print(v[-1])

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

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

v.sort()
dp = [0]*(n-1)

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

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

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

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

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


print(ans)

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

Solution (Python):

import sys


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

    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  
    v = [int(next(tokens)) for _ in range(N)]  
    solve(N, v)

if __name__ == '__main__':
    main()

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

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

for _ in range(n - 1):
    arr.sort()
    new_v = (arr[0] + arr[1]) / 2
    del arr[0:2]
    arr.append(new_v)

print(arr[0])

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

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

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

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

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


L = []
L.append(v[0])
ANS = 0
for i in range(N-1):
    N = (L[i] + v[i+1])/2
    L.append(N)
    
print(max(L))

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
a = 1
for i in range(N):
    if i != N-1:
        a *= 0.5
    ans += a*A[i]

print(ans)

Solution (Python):

N = int(input())
Val = list(map(int,input().split()))
Val.sort()
for i in range(N-1):
    x = Val.pop(0)
    y = Val.pop(0)
    Val.append((x+y)/2)
    Val.sort()

print(Val[0])

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

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


print('{:.05f}'.format(t))

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


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

    print(ans)

if __name__ == "__main__":
    main()

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

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

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

for n in range(2,N):
  ans = (ans+V[n])/2
  
print(ans)

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

v = sorted(v)

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

print(ans)

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

v.sort()
while True:
  x = v[0]
  y = v[1]
  z = (x+y) / 2
  v.pop(0)
  v.pop(0)
  v.append(z)
  v.sort()
  if len(v) == 1:
    break
  else:
    pass
  

print(z)

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

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

guzai.sort()

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

for x in range(2,n):
  ave = (ave + guzai[x])/2
  
print(ave)

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

v.sort()
tmp = 0.0
for i in range(N):
    if i == 0:
        tmp = v[i]
    else:
        tmp = (tmp+v[i])/2.0

print(tmp)

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







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

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

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

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
if N == 2:
  print(sum(A)/2)
  exit()
else:
  temp = (A[0]+A[1])/2
  for i in range(2, N):
    temp = 1/2*(A[i] + temp)
print(temp)

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

v.sort()
tmp = 0.0
for i in range(N):
    if i == 0:
        tmp = v[i]
    else:
        tmp = (tmp+v[i])/2.0

print(tmp)

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

Solution (Python):

"""
Created on Wed Sep  9 21:55:15 2020

@author: liang
"""

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

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

print(V[0])

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

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

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

s.sort()

v = 0

if n == 1:
  print(s[0])
  exit()
elif n == 2:
  print((s[0]+s[1])/2)
  exit()

c = (s[0]+s[1])/2

del s[0]
del s[0]

for i in range(n-2):
  c = (c + s[0])/2
  del s[0]
  
  
print(c)

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

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

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

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

v.sort()

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

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

Solution (Python):

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

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

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

Solution (Python):
from collections import deque

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

v.sort()

deq = deque(v)

while len(deq) != 1:
    x = deq.popleft()
    y = deq.popleft()
    
    nx = (x+y)/2
    
    deq.appendleft(nx)

ans = deq.popleft()

print(ans)

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

print(z)

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.pop(0)
  v.pop(0)
  
print(v[0])

Solution (Python):

import sys
input=sys.stdin.readline
import heapq

def main():
    n = int(input())
    values=[]
    heap_values=[]
    values=list(map(int,input().split()))
    [heapq.heappush(heap_values, value) for value in values]

    while len(heap_values)!=1:
        tmp1=heapq.heappop(heap_values)
        tmp2=heapq.heappop(heap_values)
        tmp_value=(tmp1+tmp2)/2
        heapq.heappush(heap_values,tmp_value)

    print(heap_values[0])

if __name__=="__main__":
    main()

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

Solution (Python):
n = int(input())
v = [int(x.strip()) for x in input().split()]
vs = sorted(v)
ans = 0
for i in range(n):
  a = (vs[i]/(2**(n-max(i,1))))
  ans += a
print(ans)

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

Solution (Python):
def cumsum(n,A):
    s = [0]*(n+1)
    s[0] = A[0]
    for i in range(len(A)):
        s[i+1] = (s[i] + A[i])/2
    return s

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

for i in range(n-1):
    s = cumsum(n,v)
print(s[-1])

Solution (Python):
n = int(input())
v = sorted(list(map(int,input().split())))
s = [0]*n
s[0] = v[0]

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

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

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

        ans = x/2**(n-1)
        print(ans)

else:
        print((x+v[1])/2)

Solution (Python):

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

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

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

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

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

V.sort()

res = V[0]

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

print(res / 2**(N - 1))

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

solve()

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")



n = int(input())
v = list(map(int, input().split()))
from heapq import heappop as hpp, heappush as hp
h = []
for num in v:
    hp(h, num)
while len(h)>=2:
    v0, v1 = hpp(h), hpp(h)
    hp(h, (v0+v1)/2)
ans = h[0]
print(ans)

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

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

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

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

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

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

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

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

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

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

    print(ans)


if __name__ == "__main__":
    main()

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

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

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

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

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    v = list(map(int, readline().split()))
    v.sort()
    cur = v[0]

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

    print(cur)


if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
li=list(map(int, input().split()))
li.sort()
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()

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

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

for _ in range(N-1):
	materials.sort()
	new_material = (materials[0] + materials[1])/2
	materials.pop(0)
	materials.pop(0)
	materials.append(new_material)
	
print(materials[0])

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

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

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
c=min(b)
d=0
b.pop(b.index(min(b)))
while True:
    if b==[]:
        break
    c+=min(b)
    b.pop(b.index(min(b)))
    d=c/2+d/2
    c=0
print(d)

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

Solution (Python):
import heapq
n = int(input())
heap_a = list(map(int, input().split()))




heapq.heapify(heap_a)


while True:
    tar1 = heapq.heappop(heap_a)
    tar2 = heapq.heappop(heap_a)

    heapq.heappush(heap_a, (tar1 + tar2) / 2.0)
    if (len(heap_a) == 1):
        break


print(heapq.heappop(heap_a))

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
while len(v)!=1:
    v=sorted(v)
    x=(v[0]+v[1])/2
    v.pop(0)
    v.pop(0)
    v.append(x)
print(v[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):
N = int(input())
V = list(map(int,input().split()))

V.sort()

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

print(res)

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):
def main():
    n = int(input())
    v = [int(_) for _ in input().split()]
    sort_v = sorted(v)

    while len(sort_v) > 1:
        temp_a = sort_v[0]
        temp_b = sort_v[1]
        sort_v.pop(0)
        sort_v[0] = (temp_a + temp_b)/2
        sort_v = sorted(sort_v)

    print(sort_v[0])


if __name__ == "__main__":
    main()

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

now = 0
a = sorted(value) 

while len(a) >= 2:
  a = sorted(a)
  now = (float(a[0]) + float(a[1])) / float(2)
  if len(a) >= 3:
    del a[0],a[0] 
    a.append(now)
  elif len(a) == 2:
    print(now)
    break

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

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

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
V = [int(v) for v in stdin.readline().rstrip().split()]

V.sort()

now = V[0]

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

print(now)

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)

import heapq

n = int(input())
u = list(map(int, input().split()))
heapq.heapify(u)
for _ in range(n-1):
    heapq.heappush(u, (heapq.heappop(u) + heapq.heappop(u)) / 2)

print(heapq.heappop(u))

Solution (Python):
n = int(input())
lis = list(map(int, input().split()))
lis.sort()
x = 0
y = 0

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

Solution (Python):
N,*V=map(int,open(0).read().split())
A=sorted(V)
for n in range(N-1):
    A=sorted([(A[0]+A[1])/2,]+A[2:])
print(A[0])

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

while len(v) > 1:
  v.insert(2, (v[0]+v[1])/2)
  v = v[2:]
print(*v)

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N=I()
    v=LI()
    v.sort()
    ans=v[0]
    for i in range(1,N):
        ans=(ans+v[i])/2
    print(ans)

main()

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

ans = (V[0]+V[1])/2**(len(V)-1)

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

print(ans)

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

M.sort()
x = (M[0]+M[1])/2

for m in M[2:] :
    x = (x+m)/2

print(x)

Solution (Python):
import heapq
N = int(input())
V = list(map(int, input().split()))
heapq.heapify(V)
for i in range(N-1):
  v1 = heapq.heappop(V)
  v2 = heapq.heappop(V)
  heapq.heappush(V, (v1 + v2) / 2)
print(heapq.heappop(V))

Solution (Python):








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


if __name__ == '__main__':
    
    N = int(input())
    
    Vs = [int(i) for i in input().split()]
    
    solve(N, Vs)

Solution (Python):
def mapt(fn, *args):
    return tuple(map(fn, *args))


def Input():
    return mapt(int, input().split(" "))

  
def main():
    n = int(input())
    a = sorted(Input())
    while len(a) > 1:
        x, y = a[0], a[1]
        a[0:2] = [(x+y)/2]
    return a[0]


print(main())

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v.sort()
pot=v[0]
for i in range(1,N):
    pot = 0.5*(pot + v[i])

print(pot)

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

v.sort()

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

print(v[0])

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

val = v[0]

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

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

Solution (Python):


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

print(res)

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

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

Solution (Python):
from collections import deque
n = int(input())
v = deque(sorted(list(map(int, input().split()))))
for i in range(n-1):
    v1 = v.popleft()
    v2 = v.popleft()
    v.appendleft((v1+v2)/2)
print(v[0])

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v_sort=sorted(v,reverse=False)
while len(v_sort)>1:
    v_sort=sorted(v_sort,reverse=False)
    v_sort.append((v_sort[0]+v_sort[1])/2)
    del v_sort[0]
    del v_sort[0]
print(*v_sort)

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v_sort=sorted(v,reverse=False)
for i in range(N):
    v_sort=sorted(v_sort,reverse=False)
    v_sort.append((v_sort[0]+v_sort[1])/2)
    del v_sort[0]
    del v_sort[0]
    if len(v_sort)==1:
        break
print(*v_sort)

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

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

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

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

print(v[n-1])

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

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

Solution (Python):
import sys
import numpy as np
import numba
from numba import jit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from heapq import heappop,heappush,heapify

@jit
def main(n, a):
  for _ in range(1, n):
    x = heappop(a)
    y = heappop(a)
    heappush(a, (x + y)/2)
  return a[0]

n,*a = map(int,read().split())
heapify(a)
print(main(n,a))

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

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

num=(l[0]+l[1])/2
l.pop(0)
l.pop(0)
if len(l) > 0:
  for i in range(n-2):
    num=(num+l[0])/2
    l.pop(0)
  
print(num)

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

Solution (Python):
n=int(input())
v=[int(x) for x in input().split()]
v.sort()
while len(v)!=1:
  a=v.pop(0)
  b=v.pop(0)
  v.append((a+b)/2)
  v.sort()
print(v[0])

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

if n == 2:
    ans = (values[0] + values[1])/2
else:
    while len(values) > 1:
        values.sort()
        tmp = (values[0] + values[1])/2
        values.pop(0)
        values.pop(0)
        values.append(tmp)
    ans = values[0]

print(ans)

Solution (Python):
import heapq

N=int(input())
arr=list(map(int,input().split()))
hq=[]

for i in range(N):
    heapq.heappush(hq,arr[i])
    
while len(hq)>1:
    a=heapq.heappop(hq)
    b=heapq.heappop(hq)
    heapq.heappush(hq,(a+b)/2)

print(*hq)

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

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

print(price)

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

v.sort()

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

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

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 = [int(v) for v in input().split()]

v_sorted = sorted(v)

new_list = []
for i in range(len(v)):
    if i == 0 or i == 1:
        new_list.append(v_sorted[i] / 2**(len(v)-1))
    else:
        new_list.append(v_sorted[i] / 2 ** (len(v)-i))
    
print(sum(new_list))

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

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

while len(vv) > 1:
  a, b = vv[:2]
  vv = vv[2:]
  vv = sorted([(a + b) / 2] + vv)

print(vv[0])

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

nV = sorted(V)
res = 0
res += (nV[0]+nV[1])/(2**(N-1))

for i in range(2,N):
  res += nV[i]/(2**(N-i))
    
print(res)

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

N = int(input())
heap = list(map(int,input().split()))
heapify(heap)

while(len(heap)>=2):
    x = heappop(heap)
    y = heappop(heap)
    
    heappush(heap,(x+y)/2)
print(heappop(heap))

Solution (Python):
from functools import reduce
n=int(input())
v=sorted([int(i)for i in input().split()])
x=lambda x,y:(x+y)/2
res=reduce(x,v)
print(res)

Solution (Python):
n = int(input())
A = list(map(int,input().split()))
A.sort()
from collections import deque
q = deque(A)
s = (A[0] + A[1])/2
q.popleft()
q.popleft()
while q:
    t = q.popleft()
    s +=t
    s/=2
print(s)

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

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

for n in range(N-1):
    x = V.pop(0)
    y = V.pop(0)
    V.append((x+y)/2)
    V.sort()
print(V[0])

Solution (Python):
N = int(input())
v = list(map(int, input().split()))
V = sorted(v, reverse=True)
A = 0

while N > 1:
  v1 = V.pop()
  v2 = V.pop()
  A = (v1 + v2)/2
  V.append(A)
  N -= 1

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

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

v.sort()

num = v[0]+v[1]
den = 2
for i in range(2, N):
    num += den * v[i]
    den *= 2

ans = num / den
print(ans)

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

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

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

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

print(a)

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

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

print(v[0])

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

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

while len(l) > 1:
  l = sorted(l)
  f = l.pop(0)
  s = l.pop(0)
  l.append( ( f + s ) / 2 )

print(l[0])

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

if v:
    for i in v:
        ans = (ans+i)/2

print (ans)

Solution (Python):
def ing(arr):
	summ = arr[0]
	for i in range(1, len(arr)):
		summ = (summ + arr[i]) / 2
	return summ
n = int(input())
arr = list(map(int, input().split()))
arr.sort()
print(ing(arr))

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