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(float, input().split()))

total=0
for i, num in enumerate(sorted(v)):
    if i <= 1:
        total += num
    else:
        total += 2**(i-1)*num
    
print(total/2**(N-1))

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

result=0
for i in range(1,N):
    if i==1:
        result+=(a[i-1]+a[i])/2
    else:
        result=(result+a[i])/2
print(result)

Solution (Python):

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

sorted_V = sorted(V)
value = 0
product_value = (sorted_V[0] + sorted_V[1]) / 2

for i in range(2, N):
    product_value = (product_value + sorted_V[i]) / 2

print(product_value)

Solution (Python):
import numpy as np
a = int(input())
b_list = list(map(int,input().split()))

for i in range(len(b_list)-1):
    b_list.sort()
    b_list.append(np.mean([b_list.pop(0),b_list.pop(0)]))
print(b_list[0])

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

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

Solution (Python):
input()
v=sorted(map(int,input().split()))
a=v.pop(0)
while v:
    a=(a+v.pop(0))/2
print(a)

Solution (Python):
input()
v=sorted(map(int,input().split()))
a=v.pop(0)
while v:
    a=(a+v.pop(0))/2
print(a)

Solution (Python):
input()
v=sorted(map(int,input().split()))
a=(v.pop(0)+v.pop(0))/2
while v:
    a=(a+v.pop(0))/2
print(a)

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())
*l, = map(int,input().split())
l.sort()
ans=l[0]
for i in l:
  ans = ans/2 + i/2
print(ans)

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

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

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

Solution (Python):
n = int(input())
v = list(map(float, input().split()))
while len(v) > 1:
  min_1 = min(v)
  v.remove(min_1)
  min_2 = min(v)
  v.remove(min_2)
  v.append((min_1 + min_2) / 2)
print(v[0])

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

value = map(int, input().split())

value = sorted(value)

while len(value) > 1:
    value_0 = (value[0] + value[1]) / 2
    new = [value_0]
    for i in range(2,len(value)):
        new.append(value[i])
    value = new

print(value[0])

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

    s = (V[0] + V[1]) * 0.5
    for i in range(2, N):
        s = (s + V[i]) * 0.5

    print(s)


main()

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

v = sorted(v)

for i in range(n-1) :
  ans = (v[i]+v[i+1])*0.5
  v[i+1] = ans

print(ans)

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

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

def alchemy(minNum1, minNum2):
    return (minNum1 + minNum2) / 2

while len(values) > 1:
    minNum1 = values.pop(values.index(min(values)))
    minNum2 = values.pop(values.index(min(values)))
    values.append(alchemy(minNum1, minNum2))

print(values[0])

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

arr.sort()

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

print(arr[-1])

Solution (Python):
import sys, os
import collections
import heapq

MOD = 10 ** 9 + 7

def solve(input_stream):
  N = read_int(input_stream)
  values = read_ints(input_stream)
  heapq.heapify(values)
  while len(values) > 1:
    a,b = (heapq.heappop(values), heapq.heappop(values))
    heapq.heappush(values, (a+b)/2.0)
  return [str(heapq.heappop(values))]


def read_ints(input_stream):
  return [i for i in map(int, input_stream.readline().strip().split())]

def read_int(input_stream):
  return int(input_stream.readline().strip())


if __name__ == "__main__":
    outputs = solve(sys.stdin)
    for line in outputs:
      print(line)

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

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

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

Solution (Python):
N = int(input())
H = list(map(int, input().split()))
ans=0
H=sorted(H, reverse=False)
ans=(H[0]+H[1])/2**(N-1)

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

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

Solution (Python):

N=int(input())
V=list(map(int,input().split()))
for _ in range(N-1):
    V.sort()
    V.append((V.pop(0)+V.pop(0))/2)
print(*V)

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

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

Solution (Python):
n = int(input())
a = list(map(int, input().split()))
a.sort()
def Alchemy(x) :
    if len(x) == 1 :
        print(x[0])
    else :
        a = (x[0] + x[1])/2
        l = x[2:]
        l.insert(0,a)
        return Alchemy(l)

Alchemy(a)

Solution (Python):
import sys
import heapq

if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline
def INT(): return int(input())
def MAP(): return [int(s) for s in input().split()]

N = INT()
V = MAP()

heapq.heapify(V)

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

print(heapq.heappop(V))

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

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

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

w=sorted(v)
answer=w[0]

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

print(answer)

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


print(v[0])

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

v.sort()

while len(v) > 1:
    v[1] = (v[0] + v[1]) / 2
    v = v[1:]

print((v[0]))

Solution (Python):
a=int(input())
b=list(map(int,input().split()))
b.sort()
while len(b)>1:
    c = (b[0]+b[1])/2
    del b[:2]
    b.insert(0,c)
    b.sort()
print(b[0])

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

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

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

print(ans)

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

def mix(a, l: list) -> int:
    if len(l) == 1:
        return (a + l[0])/2

    return (a + mix(l[0], l[1:]))/2

print(mix(v[0], v[1:]))

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

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

List = list(map(int,input().split()))
List.sort()
ans = 0

for i in range(N):
  a = List[i]/2**(N-i)
  if i == 0:
    a = a*2
  ans = a + ans
  
print(ans)

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

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):
from functools import reduce

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

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

Solution (Python):
import numpy as np
N = input()
a = np.array(input().split()).astype(int)
a = np.sort(a)
print((np.power(2, np.arange(len(a)) - np.insert(np.ones(len(a)-1), 0, 0)) * a / np.power(2, len(a) - 1)).sum())

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

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

v[N - 1] = v[N - 1] / (2.0 ** (N - 1))

print(sum(v))

Solution (Python):



n = int(input())
gu = sorted(list(map(float, input().split())))
count = 0

while True:
    if len(gu) > 2:
        d = (gu.pop(0) + gu.pop(0)) / 2
        gu.insert(0, d)
    if len(gu) == 2:
        count = (gu.pop() + gu.pop()) / 2
        break

print(count)

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

avg = 0
for i in range(1, N):
  if i == 1:
    avg = (v_list[0] + v_list[1])/2
  else:
    avg = (avg + v_list[i])/2
print(avg)

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

Solution (Python):
def calculate(arr):

    if len(arr) == 1:
        return arr[0]
    if len(arr) == 2:
        result = (arr[0] + arr[1]) / 2
        return result

    if len(arr) > 2:
        res = (arr[-1] + arr[-2]) / 2
        newArr = arr[:-2]
        newArr.append(res)
        return calculate(newArr)

def rank(arr):
    lastIndex = len(arr) - 1
    while lastIndex > 0:
        for i in range(lastIndex):
            if arr[i + 1] > arr[i]:
                tmp = arr[i + 1]
                arr[i + 1] = arr[i]
                arr[i] = tmp

        lastIndex = lastIndex - 1
    return arr

N = int(input())
S = input().split(" ")
arr = list(map(int, list(S)))
newArr = rank(arr)

result = calculate(list(arr))
print(result)

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

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

Solution (Python):
if __name__ == "__main__":
	N = int(input())
	List = list(map(int,input().split()))
	
	list.sort(List)
	
	
	ans = (List[0]+ List[1])/2
	i = 2
	while i < len(List):
		ans = (ans + List[i])/2
		i += 1
	print(ans)

Solution (Python):

import math
import heapq
import bisect

MOD = 10**9+7

N = int(input())


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

heapq.heapify(v)
ans = heapq.heappop(v)
for i in range(1,N):
    ans += heapq.heappop(v)
    ans /= 2

print(ans)

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

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

while len(v) > 2:
    v_new = (v[0]+v[1])/2
    v_newlist = v[2:]
    v_newlist.append(v_new)
    v_newlist.sort()
    v = v_newlist
print((v[0] + v[1])/2)

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

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


main()

Solution (Python):
from functools import reduce


def main():
    input()
    v = sorted(map(int, input().split()))
    print(reduce(lambda x, y: (x + y) * 0.5, v))


main()

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

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

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


if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
N = int(input())
v = sorted(list(map(int, input().split())))
v.reverse()
result = v.pop()
for _ in range(N-1):
    result = (result+v.pop())/2
print(result)

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

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

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

v.pop(0)
v = sorted(v,reverse=True)
print(v[0])

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

A.sort()

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

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

v_sorted=sorted(v_list, reverse=False)

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

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

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

while len(v)>1:
    v.sort(reverse=True)
    val1 = v.pop()
    val2 = v.pop()
    mean = (val1 + val2) / 2.0
    v.append(mean)
print(v[0])

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

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.sort()
last = A[0]
for x in range(0,N-1):
    num = (last + A[x+1])/2
    last = num

print(num)

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

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

Solution (Python):

import sys

input = sys.stdin.readline


sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 10 ** 9 + 7


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

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

    print(s)




if __name__ == '__main__':
    main()

Solution (Python):
def  makabe(nam, co):
  ky=(nam+co)/2.0
  return ky



n=int(input())
g=list(map(int,input().split()))
g.sort()
ty=(g[0]+g[1])/2.0
for h in range(2,n):
  ty= makabe(ty,g[h])
  
print(ty)

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

print(V_s[0])

Solution (Python):
N = int(input())
v = list(map(int, input().split())) 
import bisect
v.sort()
for i in range(N-1):
  bisect.insort(v,(v.pop(0)+v.pop(0))/2)
print(*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())
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):
n = int(input())
vi = list(map(int, input().split()))

vis = sorted(vi)


ans = vis[0]
for i in range(1, n):
    
    ans = (ans + vis[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())
A = [int(x) for x in input().split()]
A=sorted(A)
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()
s = v[0]

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

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

V.sort()

ans = []

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

print(V[N-1])

Solution (Python):

import sys













def main():
    n, *v = [int(x) for x in sys.stdin.read().split()]
    v.sort()

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


if __name__ == "__main__":
    main()

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

Solution (Python):

N = int(input())

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

v.sort()

ret = v[0]
for i in range(N):
    if i == 0: continue
    ret = (ret + v[i]) / 2

print(ret)

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

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

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

print(V[i+1])

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

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

print(V[i+1])

Solution (Python):

import sys, math
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans=count=0

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

Solution (Python):

import sys, math
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
sys.setrecursionlimit(10**8)
inf = float('inf')
ans=count=0

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

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

Solution (Python):
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
import numpy as np
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())

n = inp()
vlist = np.array(inpl())
vlist.sort()
temp = vlist[0]
for i in range(len(vlist)):
    temp = (temp + vlist[i])/2.0
print(temp)

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

for _ in range(n-1):
    a = v.pop(0)
    b = v.pop(0)
    c = (a + b) / 2
    v.append(c)
    v.sort()

print(*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):
import numpy as np
N=int(input())
v=np.sort(np.array(list(map(int,input().split(" ")))))
ind=np.insert(np.array(range(1,N))[::-1],0,N-1,axis=0)
print(sum(v/2**ind))

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

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

Solution (Python):
import heapq
import math


def solve(n, v):
    heapq.heapify(v)

    while len(v) != 1:
        x = heapq.heappop(v)
        y = heapq.heappop(v)
        z = (x + y) / 2
        heapq.heappush(v, z)

    return v[0]


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

print(solve(n, v))

Solution (Python):
from heapq import heapify,heappop,heappush
n=int(input())
a=list(map(int,input().split()))
heapify(a)
while len(a)!=1:
    b=heappop(a)
    c=heappop(a)
    heappush(a,(b+c)/2)
print(a[0])

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

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

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

a.sort()

val = a[0]
for i in a:
    val = (val+i)/2
    
print(val)

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
V.sort()
sum=V[0]
for i in range(1,N):
    sum+=V[i]
    sum/=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 = list(map(int, input().split()))

v_list.sort()

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

print(v_list[-1])

Solution (Python):
from functools import reduce

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

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

Solution (Python):
N = int(input())
v = list(map(int,input().split()))
v.sort(reverse = True)
f = v.pop()
for i in range(N-1):
    f = (f + v.pop())/2
print(f)

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

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

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

print(ans)

Solution (Python):
N = int(input())
n = list(map(int,input().split()))
for i in range(N-1):
    tmp = []
    tmp.append(n.pop(n.index(min(n))))
    tmp.append(n.pop(n.index(min(n))))
    n.append(sum(tmp)/2)
print(sum(n))

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

Solution (Python):


n=int(input())

S=input().split()
s=list(S)

for i in range(n):
  s[i]=float(s[i])


list=sorted(s)

def mazemaze(a,b):
  return (a+b)/2

ans=list[0]

for i in range(n-1):
  ans=mazemaze(ans,list[i+1])

print(ans)

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

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

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

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())
v = [int(i) for i in input().split()]
v.sort(reverse=True)
ans = 0
for i in range(n-1):
    ans += 2 ** (n-2-i) * v[i]
ans = (ans + v[-1]) / 2 ** (n-1)

print(ans)

Solution (Python):
import heapq

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

while (1 < len(v)):
    heapq.heappush(v, (heapq.heappop(v) + heapq.heappop(v)) / 2)

print(v[0])

Solution (Python):


n = int(input())
guzai_valu = list(map(int, input().split()))
heikin=0
i=1
while i <= n-1:
   guzai_valu_sort = sorted(guzai_valu)
   
   heikin=(guzai_valu_sort.pop(0)+guzai_valu_sort.pop(0))/2
   guzai_valu_sort.append(heikin)
   guzai_valu = guzai_valu_sort
   i=i+1
print(heikin)


'''自動で成分がずれるのでリスの成分の内最初のものを2回選ぶことが最小のもの
   を2つ選ぶことと等価になるんや

Solution (Python):

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

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

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

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

v_sort = list(sorted(v))

while len(v_sort) > 1:
    A = v_sort.pop(0)
    B = v_sort.pop(0)
    new = 0.5 * (A + B)
    v_sort.append(new)
    v_sort = list(sorted(v_sort))

print(v_sort[0])

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

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

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

print(ans)

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

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

Solution (Python):
import heapq

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

heapq.heapify(v)
while len(v) > 1:
    h = (heapq.heappop(v) + heapq.heappop(v)) / 2
    heapq.heappush(v, h)

print(v[0])

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

Solution (Python):
import math
import heapq

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

heapq.heapify(V)
a=heapq.heappop(V)
b=0
for i in range(len(V)):
    b=heapq.heappop(V)
    a=(a+b)/2

print(a)

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

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

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

V = sorted(V)
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()))

while len(v) > 1:
    v.sort(reverse=True)
    a = v.pop()
    b = v.pop()
    v.append((a + b) / 2)

res = v.pop()
if res.is_integer():
    res = int(res)
print(res)

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

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

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

for _ in range(N-1):
  heappush(V, (heappop(V)+heappop(V))/2)

print(heappop(V))

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

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

for _ in range(N-1):
  heappush(V, (heappop(V)+heappop(V))/2)

print(heappop(V))

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