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

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

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

for j in range(n-1):
  b.insort(v,(v[0]+v[1])/2)
  del v[0]
  del v[1]
  
print(v[0])

Solution (Python):
def _input():
    number = input()
    array = input().split()
    number_array = []
    for i in array:
        number_array.append(int(i))
    return number_array

def composition(number_array):
    number_array.sort()
    total_value = 0
    counter_flag = 0
    for i in number_array:
        if counter_flag >= 1:
            total_value = (total_value + i) / 2
        else:
            total_value = i
        counter_flag += 1

    return total_value

if __name__ == "__main__":
    array = _input()
    print(composition(array))

Solution (Python):
import numpy as np

N = int(input())
V = input().split()
V = np.array(V).astype(int)
V = np.sort(V)

U = np.array([])

for _ in range(2):
    U = np.append(U, 0.5**(N-1))
    
for i in range(2, N):
    U = np.append(U, 0.5**(N-i))

print(np.dot(U, V))

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

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

print(v[0])

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

V.sort()

value = V[0]
for n in range(1, N):
    value = (value + V[n]) / 2.0

print(value)

Solution (Python):
from functools import reduce

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

v.sort()

max_val = reduce(lambda x, y: (x+y)/2, v)

print(max_val)

Solution (Python):
if __name__ == '__main__':
    N = int(input())
    v = sorted(list(map(float, input().split())), reverse=True)
    while (len(v) > 1):
        pops = v[-2:]
        del v[-2:]
        ave = sum(pops) / 2
        v.append(ave)
    print(v.pop())

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

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


if __name__ == "__main__":
    main()

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

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

Solution (Python):
N = int(input())
List = [] * N
List = input().split(" ")
for i in range(N):
    List[i] = float(List[i]) 
List.sort()
for i in range(N-1):
    List[i+1] = ( List[i] + List[i+1] ) / 2
print(List[N-1])

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

v_s = sorted(v)

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

Solution (Python):


num = int(input())
val_list = [int(i) for i in input().split()]

val_list.sort()

init_1 = val_list.pop(0)
init_2 = val_list.pop(0)

rtn = (init_1 + init_2)/2

for i in val_list:
  rtn = (rtn + i)/2

print(rtn)

Solution (Python):
count = int(input())
numlist = list(map(int, sorted(input().split())))
result = 0

  
for i in range(1,count):
  numlist = sorted(numlist)
  sum = (numlist[1] + numlist[0]) / 2
  del numlist[0:2] 
  numlist.append(sum)

  
print(sum)

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

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

Solution (Python):
N = int(input())
arr = input()
guzai = arr.split(" ")
guzai_int = [int(i) for i in guzai]

for i in range(1, N):
  guzai_int.sort()
  x = guzai_int.pop(0)
  y = guzai_int.pop(0)
  guzai_int.append((x+y)/2)

print(guzai_int.pop())

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

Solution (Python):
import numpy as np
 
N = int(input())
Vi = np.array(list(map(int,input().split())))
for i in range(N):
    if len(Vi)>2:
        Vi = np.sort(Vi)
        Vi = np.concatenate(([Vi[:2].mean()],Vi[2:]))
    else:
        Vi = Vi.mean()
        break
print(Vi)

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

c = n*(n-1)/2
ans = []

for i in range(n-1):
	v.sort()
	m1 = v.pop(0)
	m2 = v.pop(0)
	m = (m1+m2)/2
	v.append(m)

print(v[0])

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

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

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

print(V[0])

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

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

heapify(V)

while len(V)>1:
    x = heappop(V)
    y = heappop(V)
    heappush(V, (x+y)/2.0)

print(heappop(V))

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

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

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

print(s)

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

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

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

for i in range(n-1):
    a=min(v)
    v.remove(a)
    b=min(v)
    v.remove(b)
    v.append((a+b)/2)
print(v[0])

Solution (Python):
maxi = int(input())
li = list(map(int,input().split()))
li.sort()
for i,num in enumerate(li):
    if i == 0:
        cur = num
    else:
        cur = (num+cur)/2
print(cur)

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

v.sort(reverse=True);

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

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

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

num_list = list(map(int, input().split()))
num_list.sort()

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

print(num_list[n-1])

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

ans = value[0]

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

print(ans)

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

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

Solution (Python):
N = int(input())
values = sorted(list(map(int, input().split())), reverse=True)
max_value = values[N-1] / (2**N)
for i in range(N):
    max_value += values[i]/(2**(i+1))

print(max_value)

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

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

print(v[0])

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

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


if __name__ == '__main__':
    slove()

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

v.sort()
ans = 0
for i in range(len(v)):
    if i == 0:
        ans += v[i]/2**(N-1)
    else:
        ans += v[i]/2**(N-i)
print(ans)

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

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

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

for i in range(n-1):
	composition = (list[0]+list[1])/2
	list.pop(0)
	list.pop(0)
	list.append(composition)
	list.sort()

print(list[0])

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

while 1:
    vn = sorted(vn)
    if len(vn) == 1:
        break
    new = sum(vn[:2])/2
    vn = vn[2:] + [new]

print(vn[0])

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

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

for _ in range(n - 1):
    v = sorted(v)
    value = (v.pop(1) + v.pop(0)) / 2
    v.append(value)

print(v[0])

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

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

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

print (ans)

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

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

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

listN.sort()
prev = 0
for i in listN:
  if prev == 0:
    prev = i
    continue
  prev = (prev + i ) / 2
  
print(prev)

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

Solution (Python):

N = int(input())
V = list(map(int, input().split()))
sortV = sorted(V)
ans = 0
if N == 2:
    ans = sum(V)/2
else:
    ans = ((sortV[0] +sortV[1])/2)
    for i in range(2, N):
        ans = (ans + sortV[i])/2
print(ans)

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

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

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

for _ in range(n-1):
    vn = sorted(vn)
    x = vn.pop(0)
    y = vn.pop(0)
    vn.append(merge(x, y))

print(vn[0])

Solution (Python):
input()
ns = sorted(map(int, input().split()))
s = ns.pop(0)

for n in ns:
    s = (s+n)/2
print(s)

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

numList.sort()

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

print(result)

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

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

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
z = 0
for i in range(n):
    if len(v) == 1:
        print(z)
    else:
        z = min(v)
        v.remove(z)
        z = (z + min(v))/2
        v.remove(min(v))
        v.append(z)

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

Solution (Python):

n = int(input())

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

a.sort()

for k in range(n-1):
    b=(a[0]+a[1])/2
    a.append(b)
    a.pop(0)
    a.pop(0)
    a.sort()

A =a[0]
print(A)

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

multipilier = 2**(len(v)-1)

for i in range(len(v)):
    answer = (v[i]/multipilier) + answer
    if i!=0:
        multipilier = multipilier/2

print(answer)

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

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

while len(values) > 1:
  values.append((values.pop(0) + values.pop(0)) / 2)
  values.sort()

print(values[0])

Solution (Python):


import sys
n = sys.stdin.readline()
v = sys.stdin.readline()
n = int(n)
v = v.split()
v = sorted([int(x) for x in v], reverse=True)
ans = sum([(v[i] * (1 / 2 ** (i+1))) for i in range(0,n)]) + v[(n-1)] * (1 / 2 ** (n))
print(ans)

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

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

v = sorted(v, reverse = False)

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

print(sum)

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

Solution (Python):
N = int(input())
v_str = input()
v_list_str = v_str.split(" ")
v_list_float = [0.0] * N
for i in range(N):
    v_list_float[i] = float(v_list_str[i])


v_list_float.sort(reverse=True)


ans = 0.0
for i in range(N-1):
    ans += v_list_float[i] / (2 ** (i+1))
ans += v_list_float[N-1] / (2 ** (N-1))

print(ans)

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
num = 0
while(len(a) > 2):
  n1 = a.pop(a.index(min(a)))
  n2 = a.pop(a.index(min(a)))
  n3 = (n1 + n2) / 2
  a.append(n3)
ans = (a[0]+a[1])/2
print(ans)

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

v.sort()

for i in range(1,n):
    x = v.pop(0)
    y = v.pop(0)
    xy = (x + y) / 2
    v.append(xy)
    v.sort()

print(v.pop(0))

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

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

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

for i in range(n):
    if i == 0:
        sum = lst[i]
    else:
        sum = (lst[i]+sum)/2

print(sum)

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

print(sum)

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

lst.sort()
for i in range(n):
    if i==0:
        sum=lst[i]
    else:
        sum=(sum+lst[i])/2

print(sum)

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()))
i = 0

v.sort()

while i < n -1:
  a = v.pop(0)
  b = v.pop(0)
  v.insert(0,(a+b) / 2)
  i += 1

print(v[0])

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

sum = 0
div = 1
for i in range(n):
  if i != n-1:
    div *= 2
  sum += vi[i]/div
    
print(sum)

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

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

print(v[0])

Solution (Python):
import heapq

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

heapq.heapify(l)

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

print(heapq.heappop(l))

Solution (Python):
from collections import deque
N = int(input())
v = list(map(int,input().split()))
v.sort()
que = deque(v)
for _ in range(N-1):
  a = que.popleft()
  b = que.popleft()
  c = (a+b)/2
  que.appendleft(c)
print(que.popleft())

Solution (Python):
import heapq
n = int(input())
v = list(map(int, input().split()))
v_heap = []
for i in v:
    heapq.heappush(v_heap, i)
for _ in range(n-1):
    heapq.heappush(v_heap, (heapq.heappop(v_heap)+heapq.heappop(v_heap))/2)
print(heapq.heappop(v_heap))

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

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

def main():
    """ main """
    N = int(input())
    VS = list(map(int, input().split()))
    heapify(VS)
    for _ in range(N-1):
        a, b = heappop(VS), heappop(VS)
        new_item = (a+b)/2
        heappush(VS, new_item)
    print(VS[0])

if __name__ == '__main__':
    main()

Solution (Python):

N = int(input())
nums = list(map(int,input().split(" ")))
nums.sort()
ans = 0
ans = sum(nums[0:2])/2
if N >= 3:
    for num in nums[2:]:
        ans += num
        ans/=2
print(ans)

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

arr.sort()

prev = arr[0]

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

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())
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(n-1):
    a=(v.pop(1)+v.pop(0))/2
    v.append(a)
    v.sort()
print(*v)

Solution (Python):


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

ind = n.index(min(n))
POT = n.pop(ind)
for i in range(0, len(n)):
    ind = n.index(min(n))
    POT = (POT + n.pop(ind)) / 2

print(POT)

Solution (Python):
def resolve():
    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])
    
resolve()

Solution (Python):

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

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

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

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

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

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

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

sum = 0
k = 1
worthly.sort()
worthly.reverse()
for i in worthly:
    sum += i/2**k
    k += 1
sum += worthly[N-1]/2**(N)
print(sum)

Solution (Python):


n = int(input())
s = sorted(list(map(int, input().split())))
while len(s) > 1:
    a = (s[0] + s[1]) / 2
    s.append(a)
    s = sorted(s[2:])
print(s[0])

Solution (Python):
from heapq import heappush, heappop
N = int(input())
heap = []
for v in map(int, input().split()):
    heappush(heap, v)

for _ in range(N-1):
    x = heappop(heap)
    y = heappop(heap)
    heappush(heap, (x+y)/2)

print(heappop(heap))

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

vs.sort()

def answer(N , vs):
    if N == 1:
        return vs[0]
    else:
        return (answer(N-1, vs) + vs[N-1]) / 2

print(answer(N, vs))

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

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

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.append((a+b)/2)
    v.sort()

print(v[0])

Solution (Python):
N=int(input())
A=list(map(int,input().split()))
B=list(sorted(A))
c=B.pop(0)
m=N-1
total=0
if N==2:
    max=sum(A)/2
elif N>2:
    for a in range(0,m):
        total+=B[a]/(2**(m-a))
    max=total+c/(2**m)

print(max)

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

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

print(V[0])

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


if __name__ == '__main__':
    main()

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

V = sorted(V)

ans = V[0]

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

print(ans)

Solution (Python):
N = int(input())
Lists = list(map(int,input().split()))
newLists = sorted(Lists)
k = newLists[0]
for x in range(1,N):
  k += newLists[x]
  k = k/2
print(k)

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

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

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

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

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

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

Solution (Python):



import sys
import math
import bisect
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

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

Solution (Python):
n=input().strip()
n=int(n)
if n>=2 and n<=50:
    num=list(map(int,input().strip().split()))
num.sort()

if n==2:
    print(sum(num)/2)
else:
    num.append((num[0]+num[1])/2)
    num=num[2:]
    for i in range(len(num)-1):
        num.append((num[-1]+num[0])/2)
        num=num[1:]
    print(num[-1])

Solution (Python):
n=int(input())
c=list(map(float,input().split()))
c.sort()
k=n
for i in range(n-2):
  v=(c[0]+c[1])/2
  c=c[2:]
  if c[k-3]<v:
    c.append(v)
    break
  for j in range(k-2):
    if c[j]>=v:
      c.insert(j,v)
      break
  k=k-1
print((c[0]+c[1])/2)

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




v.sort()


for i in range(n):
    
    
    if len(v) == 1:
        break
        
    v = [(float(v[0]) + float(v[1]))/2] + v[2:]
    

print(v[0])

Solution (Python):
N = int(input())
Vs = input().split()

if N == 2:
    print(sum([int(x) for x in Vs])/N)
else:
    lists = [int(x) for x in Vs]
    while N > 1:
        lists.sort()
        x = (lists.pop(0) + lists.pop(0)) / 2
        lists.insert(0, x)
        N -= 1

    print(lists[0])

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

v = sorted(v)

while True:
    if len(v) == 1:
        break
    val = (v[0] + v[1]) / 2
    v.pop(0)
    v.pop(0)
    v.insert(0, val)

print(v[0])

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

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

num_lis.sort(reverse = True)
total = 0
for n in range(N):
    if n < (N-1):
        total += num_lis[n] * (1/2)**(n+1)
    else:
        total += num_lis[n] * (1/2)**(n)
print(total)

Solution (Python):
N = int(input())
A = list(map(int, input().split()))
while len(A) >= 2:
  A.sort()
  A.append((A[0] + A[1])/2.0)
  A = A[2:]
print(A[0])

Solution (Python):
N = int(input())
a = sorted(list(map(float, input().split())))
at = a.pop(0)

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

print("%.5f" % at)

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

Solution (Python):

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

vs = sorted(v)

for i in range(N-1):

    a=vs[0]

    b=vs[1]
    c=(a+b)/2
    vs.remove(b)
    vs.insert(0,c)
    vs.remove(a)
    
    

print(vs[0])

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

Solution (Python):
def alchemist(N: int, V: list)->float:
    V.sort()
    s = V[0]

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

    return s


if __name__ == "__main__":
    N = int(input())
    V = list(map(int, input().split()))

    ans = alchemist(N, V)
    print(ans)

Solution (Python):


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

v.sort()

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

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

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

Solution (Python):
from heapq import heappush, heappop
import re
from collections import deque
import sys
import math
input = sys.stdin.readline


def int_raw():
    return int(input())

def str_in():
    return input().strip("\n")

def ss_raw():
    return input().split()


def ints_raw():
    return tuple(map(int, ss_raw()))


DIV = 10**9+7


def mod_inv_prime(a, mod=DIV):
    return pow(a, mod-2, mod)


def mod_inv(a, b):
    r = a
    w = b
    u = 1
    v = 0
    while w != 0:
        t = r//w
        r -= t*w
        r, w = w, r
        u -= t*v
        u, v = v, u
    return (u % b+b) % b


def ncr(n, r, mod=DIV):
	r = min(r, n-r)
	ret = 1
	for i in range(1, r+1):
		ret = ret * (n-i+1) % mod
		ret = ret * mod_inv(i, mod) % mod
	return ret


class UnionFind:
    def __init__(self, n):
        self.par = [i for i in range(n+1)]
        self.rank = [0] * (n+1)
        self.mini = [i for i in range(n+1)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if self.rank[x] < self.rank[y]:
            self.par[x] = y
        else:
            self.par[y] = x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
        mini = min(self.mini[x],self.mini[y])
        self.mini[x]=mini
        self.mini[y]=mini
    
    def same_check(self, x, y):
        return self.find(x) == self.find(y)

def main():
    n = int_raw()
    As = list(ints_raw())
    As.sort()
    ans = As[0]
    for a in As[1:]:
        ans = (ans+a)/2.0
    return ans
print(main())

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

while True:
    v.sort(reverse=True)
    x1 = v.pop()
    x2 = v.pop()
    x = (x1 + x2) / 2
    v.append(x)

    if len(v) == 1:
        break

print(v[0])

Solution (Python):
N=int(input())
values=[int(thing) for thing in input().split(" ")]
values.sort()
ret=0
for i in values:
    if ret!=0:
        ret=(i+ret)*0.5
    else:
        ret=i
print(ret)

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

Solution (Python):

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

while len(v) > 1:
    v.insert(0, (v.pop(0) + v.pop(0)) / 2)

print(v[0])

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

Solution (Python):
n = int(input())
v_list = list(map(int,input().split()))
while len(v_list) >= 3:
  v_list.sort()
  new_v = (v_list[0] + v_list[1]) /2
  v_list.pop(0)
  v_list.pop(0)
  v_list.append(new_v)
print((v_list[0] + v_list[1]) / 2)

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