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()
while len(v) != 1:
    mix = ( v.pop(1) + v.pop(0) ) / 2
    v.append(mix)
    v.sort()
else:
    print(v[0])

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

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

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

vn.sort()
sumV = vn[0]

for v in vn[1:]:
    sumV = (sumV + v)/2
print(sumV)

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

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

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

Solution (Python):
n = int(input())
list = list(map(int, input().split()))
list.sort()
list2 = [list[0]]
for i in range(1,n):
    list2.append(list[i] * 2 ** (i-1))

print(sum(list2) / 2 ** (n-1))

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

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

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

print(V[0])

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

v.sort()

sum = v[0]

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

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


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


print(v[0])

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

Solution (Python):



def main():
    
    n = int(input())
    v = list(map(int, input().split()))
    v.sort()
    ans = 0
    for num, i in enumerate(v):
        if num<2:
            ans += i/2**(n-1)
        else:
            ans += i/2**(n-num)

    
    print(ans)


if __name__ == '__main__':
    main()

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())),reverse = True)
ans = 0
for i in range(len(v)-1):
    ans += v[i]/2**(i+1)
ans += v[-1]/2**(len(v)-1)
print(ans)

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

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
v.sort()
if len(v)==1:
    print(v[0])
elif len(v)==2:
    print((v[0]+v[1])/2)
else:
    s=(v[0]+v[1])/2
    for j in range(2,N):
        s=(s+v[j])/2
    print(s)

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

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

sortedv = sorted(v)


ans = sortedv[0]
for i in range(n):
    ans = (ans+sortedv[i])/2

print(ans)

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

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

Solution (Python):
import numpy as np
n = int(input())
v = np.array(list(map(float, input().split())))
v.sort()

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

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

def mix(v):
  l1 = min(v)
  v.remove(l1)
  l2 = min(v)
  v.remove(l2)
  v.append((l1+l2)/2)
  
for i in range(N-1):
  mix(v)
  
print(*v)

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

Solution (Python):
def main():
    n = int(input())
    v = [int(x) for x in input().split()]
    temp = 0
    v = sorted(v)
    for i in range(n-1):
        if i == 0:
            temp = (v[i]+v[i+1])/2
            continue
        temp = (temp+v[i+1])/2
    print(temp)


if __name__ == '__main__':
    main()

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):
n=int(input())
values=[int(i) for i in input().split()]
values.sort()

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

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

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

for vv in v:
    ans = (ans + vv)/2

print(ans)

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

v_list.sort()

score = v_list[0]
for v in v_list[1:]:
    score = (score + v)/2

print(score)

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

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

Solution (Python):
import itertools
n = int(input())
a = list(map(int, input().split()))
a.sort()
start = 2 ** (len(a) - 1)

ans = a[0] / start
for v in a[1:]:
    ans += v / start
    start //= 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):
n=int(input())
x=list(map(int,input().split()))
ans=0
a=min(x)
x.remove(min(x))
b=min(x)
x.remove(min(x))
ans+=(a+b)/2
while len(x)>0:
    c=min(x)
    ans=(ans+c)/2
    x.remove(min(x))
print(ans)

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

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

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

V_sorted=sorted(V)

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

print(now_value)

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

for i in range(N - 1):
	p = (w.pop(0) + w.pop(0)) / 2
	w.insert(0, p)

print(w[0])

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

Solution (Python):
n = int(input())
seq = sorted((int(x) for x in input().split()))
cur_val = seq[0]
for i in range(n-1):
	cur_val = (cur_val + seq[i+1]) / 2
print(cur_val)

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

Solution (Python):
import heapq
N = int(input())
V = list(map(int, input().split()))
heapq.heapify(V)
while len(V) > 2:
    min_ = heapq.heappop(V)
    second_min = heapq.heappop(V)
    heapq.heappush(V, (min_+second_min)/2)
else: print((V[0] + V[1]) / 2)

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

lists.sort()

for i in range(n - 1):
    lists.insert(0, (lists.pop(0) + lists.pop(0))/2)

print(lists[0])

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


import heapq

heapq.heapify(V_list)


for i in range(N-1):
        v1=heapq.heappop(V_list)
        v2=heapq.heappop(V_list)
        new_v = (v1+v2)/2
        heapq.heappush(V_list,new_v)





print(V_list[0])

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

v.sort()

while len(v) != 1:
    a = v.pop(0)
    b = v.pop(0)
    v.insert(0, (a+b)/2)

print(v[0])

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

v_list.sort(reverse=True)

while len(v_list) > 1:
  v_1 = v_list.pop()
  v_2 = v_list.pop()
  new = (v_1 + v_2) /2
  v_list.append(new)
  v_list.sort(reverse=True)
print(v_list[0])

Solution (Python):
N = int(input())
a = list(map(int,input().split()))
import heapq
heapq.heapify(a)
for i in range(N-1):
  x = heapq.heappop(a)
  y = heapq.heappop(a)
  z = (x+y)/2
  heapq.heappush(a,z)
answer = heapq.heappop(a)
print(answer)

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
    V[i] = 0

print(V[len(V)-1])

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

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

Solution (Python):
def t(v):
    v.sort()
    while len(v) > 1:
        v[0] = (v[0] + v.pop(1)) / 2
    return v[0]


if __name__ == '__main__':
    n = input()
    v = list(map(int, input().split()))
    print(t(v))

Solution (Python):
from collections import deque

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

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

print(Value.pop())

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

v.sort(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)

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)
	a = (min1 + min2) / 2
	v.append(a)
print(v[0])

Solution (Python):
N=int(input())
V=sorted(map(int,input().split()),reverse=True)
ans=V[-1]*0.5**(N-1)
for i in range(1,N):
    ans+=V[i-1]*0.5**i
print(ans)

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

v = sorted(v)

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

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

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

print (ans)

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

v.sort()

sum = v[0]

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

print(sum)

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

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

A = sorted(A)

for index in range(N - 1):
    a = A[index]
    b = A[index + 1]
    A[index + 1] = (a + b) / 2

print(A[N - 1])

Solution (Python):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

from heapq import heappop,heappush,heapify

N,*V = map(int,read().split())

heapify(V)

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

answer = V[0]
print(answer)

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    values = sorted([int(n) for n in input().split()], reverse=True)
    ret = 0
    while len(values) > 1:
        tmp = (values[-1] + values[-2]) / 2
        del values[-1]
        values[-1] = tmp
    print(values[0])

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

v.sort()

sum = 0

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

print(sum)

Solution (Python):
n = int(input())
l = [int(x) for x in input().split()]
l.sort()
res = l[0];

for i in l:
	res = (res+i)/2
print (res)

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

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

ans += num_list[n-1] / 2**(n-1)
print(ans)

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

v.sort()

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

print(v[0])

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

v.sort()

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

print(v[0])

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

s_Vi = sorted(Vi)

i = 1

while i < N:
    s_Vi2 = s_Vi[2:]
    s_Vi2.append(sum(s_Vi[:2])/2)
    s_Vi = sorted(s_Vi2)
    i += 1

print(s_Vi[0])

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

vlist.sort(reverse=True)
while(len(vlist)>1):
  v1=vlist.pop()
  v2=vlist.pop()
  v=1.0*(v1+v2)/2
  vlist.append(v)
  vlist.sort(reverse=True)
  
print(vlist[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=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(int, input().split()))
v.sort()
Value = v[0]

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

print(Value)

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

print(sum)

Solution (Python):

if __name__ == '__main__':
    n = int(input())
    Arrnums = sorted([float(x) for x in input().split(' ')])
    j = 1
    q = Arrnums[0]
    for i in range(j, n):
        q = (Arrnums[i] + q)/2

    print(q)

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

Solution (Python):
import heapq

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





heapq.heapify(v)
sum = heapq.heappop(v)

for i in range(1, N):
    sum += 2 ** (i - 1) * heapq.heappop(v)

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

Solution (Python):
ii = lambda : int(input())
mi = lambda : map(int, input().split())
li = lambda : list(map(int, input().split()))

import numpy as np

n = ii()
v = li()

x = sorted(v)

for i in range(n):
    if i>1:
        x[i] = x[i]*(2**(i-1))

print(sum(x)/(2**(n-1)))

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

import heapq

heapq.heapify(v)

for i in range(N-1):
  a = heapq.heappop(v)
  b = heapq.heappop(v)
  heapq.heappush(v, (a+b)/2)
print(v[0])

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

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

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

print(to)

Solution (Python):

import sys




args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False




N = int(input())

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




if em: sys.stdin = open('/dev/tty')
if em : embed()





vs_sorted = sorted(vs)
vs_sum = vs_sorted[0]

for i in range(1, len(vs_sorted)):
  vs_sum = vs_sum + 2**(i-1) * vs_sorted[i]

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

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

Solution (Python):
N = input()
a = input().split()

a = [float(i) for i in a]
p = 1
list.sort(a)

N = int(N)
for j in range(N-1):
    sum = a[j]
    for i in range(1):
        sum = sum + a[p]
        ans = sum / 2
        a[p] = ans
        p += 1
    list.sort(a)
    

ans = sum / 2
print(ans)

Solution (Python):
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    a= heappop(L)
    b= heappop(L)
    s=(a+b)/2
    heappush(L,s)
print(s)

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

Solution (Python):
if __name__ == '__main__':

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

	
	A.sort()

	num = 0
	for i in range(n-1):
		if i == 0:
			num = ( A[i] + A[i+1] ) / 2
		else:
			num = ( num + A[i+1]  ) / 2

	print(num)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    v = list(map(int, input().rstrip('\n').split()))
    v.sort()
    t = 0
    for i in range(n):
        if i != 0:
            t = (t + v[i]) / 2
        else:
            t += v[i]
    print(t)


if __name__ == '__main__':
    slove()

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

Solution (Python):
n = int(input())
v_list = list(map(int, input().split()))
v_list.sort()
sum = 0
for index in range(len(v_list)):
  if not index == 0:
    keisuu = pow(0.5, n-index)
  else:
    keisuu = pow(0.5, n-1)
  sum += (keisuu * v_list[index])
print(sum)

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

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

v_list.sort()

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

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

Solution (Python):
import heapq

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


for i in range(n-1):
  p1 = heapq.heappop(v)
  p2 = heapq.heappop(v)
  heapq.heappush(v, (p1+p2)/2)

print(v[0])

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

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

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

V.sort()

temp = V[0]
for n in range(N):
    temp = (V[n] + temp)/2

print(round(temp, 6))

Solution (Python):

def main():
    A = int(input())
    K = [int(x) for x in input().split()]
    K = sorted(K)
    ans = K[0]
    for idx in range(1, A):
        ans = (ans + K[idx])*0.5
    print(ans)


if __name__ == "__main__":
    main()

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

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

print(new[n-1])

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

sort_lst = sorted(sozai_lst)

for i in range(n-1):
    t = (sort_lst[0]+sort_lst[1])/2
    del sort_lst[1]
    sort_lst[0] = t

print(sort_lst[0])

Solution (Python):
from sys import stdin

N = int(stdin.readline())
v = list(map(int, stdin.readline().split()))

v.sort()

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

print(value)

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] + v[i+1]) / 2

print(v[N-1])

Solution (Python):
from __future__ import print_function


import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )



import random


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

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

    print(sum/pow(2,n-1))
    return

if __name__ == '__main__':
    main()

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

Solution (Python):
from functools import reduce

if __name__ == "__main__":
    n = int(input())
    ingredients = list(map(float, input().split()))
    ingredients.sort()
    print(reduce((lambda x, y: (x + y) / 2), ingredients))

Solution (Python):

import heapq


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

heapq.heapify(V)

for i in range(N-1):
    a= heapq.heappop(V)
    b= heapq.heappop(V)
    c=(a+b)/2
    heapq.heappush(V,c)

ans = heapq.heappop(V)
print(ans)

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

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

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

print(value)

Solution (Python):
import heapq
n = int(input())
v = list(map(int, input().split()))
heapq.heapify(v)
while len(v) > 1:
  num1 = heapq.heappop(v)
  num2 = heapq.heappop(v)
  heapq.heappush(v, (num1 + num2) / 2)
print(v[0])

Solution (Python):

import heapq

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

while len(v_l) > 1:
    heapq.heapify(v_l)
    tmp1 = heapq.heappop(v_l)
    tmp2 = heapq.heappop(v_l)
    heapq.heappush(v_l, (tmp1+tmp2)/2)

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

Solution (Python):
N = int(input())
values = list(map(int, input().strip().split()))
total = 0
values.sort()
step = 0

while len(values) > 1:
    new = (values[step] + values[step + 1]) / 2
    del values[0]
    del values[0]
    values = [new] + values
    
print(values[0])

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

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

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

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

Solution (Python):
def solve():
    N, *vl = map(float, open(0).read().split())
    vl.sort()
    
    for _ in range(int(N)-1):
        a, b = vl[0], vl[1]
        vl[1] = (a + b) / 2
        vl = vl[1:]
    
    print(vl[0])

if __name__ == '__main__':
    solve()

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

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

Solution (Python):
n=int(input())
Values=list(map(int,input().split()))
Values=sorted(Values)
i=1
while i<=n-1:
    x=Values.pop(0)
    y=Values.pop(0)
    new=(x+y)/2
    Values.append(new)
    Values=sorted(Values)
    i+=1
print(*Values)

Solution (Python):
import heapq as hq
N = int(input())
V = [int(i) for i in input().split()]
hq.heapify(V)
for i in range(N-1):
    a = hq.heappop(V)
    b = hq.heappop(V)
    hq.heappush(V,(a+b)/2)
print(V[0])

Solution (Python):
import heapq
n = int(input())
x=0
d=list(map(int,input().split()))
while len(d)>=2:
    d.sort()
    x=(d[0]+d[1])/2
    heapq.heappop(d)
    heapq.heappop(d)
    d.append(x)
print(x)

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

v.sort()
avg = v[0]
for i in v[1:]:
    avg = (avg + i)/2

print(avg)

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

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

print(ans[-1])

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

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

v.sort()
price=v[0]

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

print(price)

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

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

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

Solution (Python):
def main():
    v = sorted([int(i) for i in open(0).read().split()[1:]])
    ans = v[0]
    for i in v[1:]:
        ans = (ans + i) * 0.5
    print(ans)
    return


main()

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

Solution (Python):
def main():
    v = sorted([int(i) for i in open(0).read().split()[1:]])
    ans = None
    for i in v:
        if ans:
            ans = (ans + i) * 0.5
        else:
            ans = i
    print(ans)
    return


main()

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

for i in range(n-1):
    v.sort()
    num1 = v.pop(0)
    num2 = v.pop(0)
    v.append( (num1+num2)/2)
print(v[0])

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

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

Solution (Python):
from functools import reduce

N = int(input())
l = sorted(list(map(int, input().split())))
result = reduce(lambda a,b: (a + b) / 2, l)

print(result)

Solution (Python):
import heapq

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

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

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

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=sorted(map(int,input().split()))
mean = a[0]
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 = sorted([int(i) for i in input().split()],reverse=True)
while len(v) != 1:
    a = v.pop()
    b = v.pop()
    v.append((a+b)/2)
print(v[0])

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

Solution (Python):
import heapq

n = int(input())
item = [int(i) for i in input().split()]
heapq.heapify(item)

while (len(item) != 1):
    a = heapq.heappop(item)
    b = heapq.heappop(item)
    heapq.heappush(item, (a + b) / 2)

print(item[0])

Solution (Python):
a = int(input())
arr = sorted(list(map(int, input().split())))[::-1]
while len(arr) != 1:
    x = arr.pop()
    y = arr.pop()
    arr.append((x+y)/2)
print(arr[0])

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

while len(v) != 1:
    min_1 = min(v)
    del v[v.index(min_1)]
    min_2 = min(v)
    del v[v.index(min_2)]
    v.append((min_1 + min_2)/2)
    
print (v[0])

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] + V[i+1]) / 2
print(V[-1])

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

for i in range(N - 1):
    v = sorted(v, reverse=True)
    m1 = v.pop()
    m2 = v.pop()
    v.append((m1 + m2) / 2)

print(v[0])