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):
import numpy as np

N = int(input())
v = np.fromstring(input(), sep=' ')
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 = list(map(int,input().split()))
v_list.sort()
value = v_list[0]
for i in range(1,n):
    value = (value+v_list[i])/2

print(value)

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

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


V_list = sorted(V_list)
result = (V_list[0] + V_list[1]) /2
for i in range(2,N):
    tmp = (result + V_list[i] )/2
    result = ((result + V_list[i]) /2)
print(result)

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

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

for i in range(n):
    if i < 2:
        continue
    
    an=(an+li[i])/2

print(an)

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

v = sorted(V)
new = (v[0] + v[1])/2

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

print(new)

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

H.sort(reverse=True)

for i in range(len(H)):
    H[i]=H[i]/(2**(i+1))

H[len(H)-1]=H[len(H)-1]*2

print(sum(H))

Solution (Python):

n = int(input())
from decimal import Decimal
v = list(map(int,input().split()))
v = list(map(Decimal,v))

from heapq import heappush, heappop, heapify
heapify(v)
for _ in range(n-1):
    i1 = heappop(v)
    i2 = heappop(v)
    heappush(v,(i1+i2)/2)
print(sum(v))

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

v.sort()

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

ans = v[N-1]

print(ans)

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

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

Solution (Python):
from functools import reduce
def avg(a,b):
    return (a+b)/2
n = int(input())
vlist = [float(i) for i in input().split()]
vlist.sort()
ans = reduce(avg,vlist)
print(ans)

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

Solution (Python):
import bisect

N = int(input())

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

v_list = sorted(v_list)

while(1):
    if len(v_list) == 1:
        break
    v1 = v_list.pop(0)
    v2 = v_list.pop(0)
    v = (v1+v2) / 2

    index = bisect.bisect_left(v_list, v)
    v_list.insert(index, v)

print(v_list[0])

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

v_sorted = sorted(v)

value = v_sorted[0]
for i, _ in enumerate(v_sorted[:-1]):
    value = (value + v_sorted[i + 1]) / 2

print(value)

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

V.sort()
print(sum([vi/(2**(N-i)) if i >=1 else vi/(2**(N-1)) for i,vi in enumerate(V)]))

Solution (Python):
import sys
from math import *
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  

n = ni()
vvv = na()
list.sort(vvv)
for i in range(n-1):
    m = (vvv[0]+vvv[1])/2
    vvv.append(m)
    vvv.pop(0)
    vvv.pop(0)
    list.sort(vvv)
print(vvv[0])

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

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

print(ans)

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

def f(v):
    if len(v) == 1:
        return v[0]
    return (f(v[:-1]) + v[-1]) / 2

print(f(v))

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

print(value)

Solution (Python):
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i, num in enumerate(a):
  if i == 0:
    ans = num
  else:
    ans = (ans + num) / 2
print(ans)

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

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

S.sort()
first = S.pop(0)
second = S.pop(0)
val = (first+second)/2
for d in S:
  val = (val+d)/2
  
print(val)

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

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

v.sort()

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

print(a)

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

while v:
    ans = (ans + v.pop(0)) / 2

print(ans)

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

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

print(res)

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

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

print(value)

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

Solution (Python):



def solve(N, v):
    v = list(sorted(v))
    a = v[0]
    for b in v[1:]:
        a = (a+b) / 2.0
    return a

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

    ans = solve(N, v)

    print(ans)

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

v.sort()

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

  
print(mean)

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

Solution (Python):
from functools import reduce
n = int(input())
v = list(map(int, input().split()))
v.sort()
r = reduce(lambda a, b : (a + b) / 2, v[1:], v[0])
print(r)

Solution (Python):

import heapq as hq

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

hq.heapify(v)

while len(v) > 1:
    v1 = hq.heappop(v)
    v2 = hq.heappop(v)
    hq.heappush(v, (v1+v2)/2)

print(hq.heappop(v))

Solution (Python):
tmp = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse= True)
new_material = 0
for i in range(0,tmp-1):
    new_material = (A.pop() + A.pop())/2
    A.append(new_material)
print(A.pop())

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

print(V_result)

Solution (Python):
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n = int(input())
    vl = list(map(int, input().split()))

    vl.sort()

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

    print(ans)

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

minmin = sorted(V)

tmp = -1
for i in range(N):
    if i == 0:
        continue
    else:
        if tmp == -1:
            tmp = (minmin[i-1] + minmin[i])/2
        else:
            tmp = (tmp + minmin[i])/2
    

print(tmp)

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

res = vv.pop(0)
while len(vv) > 0:
    res = (res + vv.pop(0)) / 2

print(res)

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

print(result)

Solution (Python):
import sys

N = int(sys.stdin.readline())
vlist = sorted(list(map(int, sys.stdin.readline().split())))

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

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

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

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

n = getN()
nums = sorted(getList())

tmp = nums[0]
for num in nums[1:]:
    tmp = (tmp + num) / 2

print(tmp)

Solution (Python):
from heapq import *

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

while 1 < len(v_list):
    item = (heappop(v_list)+heappop(v_list))/2
    heappush(v_list, item)

print(v_list[0])

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

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

    while len(v_list) > 1:
        buf = sorted(v_list)
        v_list.remove(buf[0])
        v_list.remove(buf[1])
        v_list.append((buf[0] + buf[1]) / 2)

    print(v_list[0])

if __name__ == '__main__':
    main()

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

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

vi = sorted(vi)
c = vi[0]/(2**(N-1))
for i in range(1,N):
  c = c + vi[i]/(2**(N-i))

print(c)

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

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

print(sum(v))

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

Solution (Python):
n = int(input())
vl = list(map(int, input().split()))
vl.sort(reverse=True)
while len(vl) > 1:
    a = vl.pop()
    b = vl.pop()
    vl.append((a + b) / 2)
print(vl.pop())

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

A.sort()
val = A[0]
for i in range(1,N):
    val = (val+A[i])/2.0
print(val)

Solution (Python):
n = int(input())
vL = list(map(int,input().split()))
vL_sort = sorted(vL)
vL_sum = (vL_sort[0] + vL_sort[1])/2
if n >= 2:
    for i in range(2,n):
        vL_sum = (vL_sum+vL_sort[i])/2
print(vL_sum)

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

is_first = True
sum = 0
for i in v:
    if is_first:
        sum += i
        is_first = False
    else:
        sum = (sum + i) / 2.0

print( sum)

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

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

    values = sorted(values, reverse=True)
    weights = [(1/2)**(i+1) for i in range(N-1)] + [(1/2)**(N-1)]

    total_value = sum([values[i]*weights[i] for i in range(N)])

    print(total_value)


if __name__ == '__main__':
    C()

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

Vs.sort()

for vi in range(1,len(Vs)):
    Vs[vi]=(Vs[vi]+Vs[vi-1])/2

print(Vs[-1])

Solution (Python):
from sys import stdin
n = int(input())
v = [int(x) for x in stdin.readline().rstrip().split()]

w = sorted(v)

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

print(w[n-1])

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

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

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
    v.sort()
print(v[n-1])

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

tmp = 0
for idx,val in enumerate(v):
        if tmp == 0:
                tmp = (val + v[idx + 1]) / 2
        else:
                tmp = (tmp + v[idx + 1]) / 2
        
        if idx == len(v) - 2:
                print(tmp)
                exit()

Solution (Python):
n = int(input())
value = list(map(int, input().split()))
value.sort()
while len(value) > 2:
    a = value.pop(0)
    b = value.pop(0)
    value.insert(0, (a+b)/2)
print(sum(value)/2)

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

Solution (Python):
import heapq

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

heapq.heapify(v)
a = heapq.heappop(v)
b = heapq.heappop(v)
tmp = (a+b) / 2
heapq.heappush(v, tmp)

while len(v) != 1:
    heapq.heapify(v)
    a = heapq.heappop(v)
    b = heapq.heappop(v)

    tmp = (a+b) / 2
    heapq.heappush(v, tmp)
print(v[-1])

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
V = sorted(V)
l = []
while (True):
  V.append(sum(V[:2])/2)
  del V[:2]
  V = sorted(V)
  if (len(V) == 1):
    break
print(V[0])

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

while len(A) != 1:
  a = A.pop(A.index(min(A)))
  b = A.pop(A.index(min(A)))
  A.append((a+b)/2)
print(A[0])

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

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

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

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

v.sort()

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

print(ans)

Solution (Python):


n=int(input())
d=input().split(" ")
for i in range(n):
   d[i]=int(d[i])
s=sorted(d,reverse=False)

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

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

v.sort()

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

print(tmp)

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

v.sort()

tmp = 0
for i in v:
    if tmp == 0:
        tmp = i
    else:
        tmp = (tmp + i) / 2
print(tmp)

Solution (Python):

"""
Spyder Editor

This is a temporary script file.
"""
n = int(input())
v = list(map(int, input().split()))
v.sort()
sp = 0
d = (int(v[0]) + int(v[1])) / 2
for i in range(2, n):
    d = (d + int(v[i])) / 2
print(d)

Solution (Python):
def main():
  Nums = int(input())
  numbers = map(int,input().split())

  nums_ = sorted(numbers)
  
  val = (nums_[0]+nums_[1])/2.0
  if Nums==2:
    print(val)
    return

  for i in range(2,len(nums_)):
    if i == 0:
      val = (nums_[i]+nums_[i+1])/2.0
    else:
      val = (val + nums_[i])/2.0
  print(val)  
  return


if __name__ == "__main__":
  main()

Solution (Python):
from collections import deque

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

val = V.popleft()
for i in range(N - 1):
    val2 = V.popleft()
    val = (val + val2) / 2

print(val)

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

lastV = sortedV[-1]
c = 2
res = 0
for v in sortedV:
    res += v / c
    c *= 2

res += lastV / (c / 2)
print(res)

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

result = n_list.pop(0)
for x in n_list:
    result = (result + x)/2

print(result)

Solution (Python):
N = int(input())
V = list(map(int, input().split()))
max_value = 0
for i in range(N-1):

    temp = min(V)
    V.remove(temp)
    temp2 = min(V)
    V.remove(temp2)

    V.append((temp+temp2)/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):
import random
import math
import collections
import itertools
import functools
import operator
import os
import sys

ri = lambda: map(int, raw_input().split())
def pi(a): print (' '.join(map(str, a)))

n, a = input(), ri()
print reduce(lambda a, b : (a + b) / 2.0, sorted(a))

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

Solution (Python):
import numpy as np

N=int(input())
V=np.sort(np.array(input().split(),dtype=np.float))

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

print(np.max(V))

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

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

lis = sorted(lis)

aveSum = lis[0]
for i in range(1, n):
    aveSum += lis[i]
    ave = aveSum / 2
    aveSum = ave

print(ave)

Solution (Python):

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

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

print(ans)

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

Solution (Python):
num = int(input())
nums = [int(s) for s in input().split()]
nums.sort()
for i in range(num - 1):
  p = (nums[0] + nums[1]) / 2
  nums[0] = p
  del nums[1]
print(nums[0])

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

if __name__ == '__main__':
    main()

Solution (Python):
import sys
def main():
    input = sys.stdin.readline
    n = int(input())
    Vs = list(map(int, input().split()))
    
    Vs_sorted = sorted(Vs)

    for i in range(n):
        
        x = Vs_sorted[0]
        y = Vs_sorted[1]
        z = (x + y) / 2
        Vs_sorted.pop(0)
        Vs_sorted.pop(0)
        Vs_sorted.append(z)
        Vs_sorted.sort()
        if len(Vs_sorted) == 1:
          break

    print(Vs_sorted[0])
 
if __name__ == '__main__':
    main()

Solution (Python):
n=int(input())
a=sorted(map(int,input().split()))
for i in range(len(a)-1):
  b=(a.pop(0)+a.pop(0))/2
  a.append(b)
  a=sorted(a)
print(*a)

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

vs.sort()

while len(vs) > 1:
	a = vs.pop(0)
	b = vs.pop(0)
	c = (a + b) / 2
	vs.insert(bisect.bisect_left(vs, c), c)

print(vs[0])

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

V = sorted(V)

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

print(ans)

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

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

sum = 0
for i in range(len(v)):
    if i == len(v) - 1:
        sum += v[i] / 2**i
    else:
        sum += v[i] / 2**(i + 1)
        

print(sum)

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

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

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

from heapq import *

heapify(l)

for i in range(n-1):
    tmp1 = heappop(l)
    tmp2 = heappop(l)
    heappush(l, (tmp1+tmp2)/2)
print(l[0])

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

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

nums = input().split()

for num in range(a):
  nums[num] = int(nums[num])

nums.sort()

result = int(nums[0])
for num in range(1,a):
  result = (result + int(nums[num]))/2

print(result)

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

r_v_list = sorted(v_list)

total = 0

for i, v in enumerate(r_v_list[1:]):
    if i == 0:
        total = (r_v_list[0] + v) / 2
    else:
        total = (total + v) / 2

print(total)

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

    for _ in range(N - 1):
        V.sort()
        ans = (V.pop(0) + V.pop(0)) / 2
        V.append(ans)

    print(ans)


if __name__ == '__main__':
    p_c()

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

sozai = sorted(sozai)

ans = 0
for i, value in enumerate(sozai):
  if i >= 2:
    ans = (ans + value) / 2    
  else:
    ans = (sozai[0] + sozai[1]) / 2

print(ans)

Solution (Python):

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

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

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

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

while len(l) > 2:
    l = sorted(l, reverse=True)
    a = l.pop()
    b = l.pop()
    l.append((a+b)/2)

print((l[0]+l[1])/2)

Solution (Python):
import decimal
import heapq


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

heapq.heapify(vs)


while len(vs) != 1:
    v1 = heapq.heappop(vs)
    v2 = heapq.heappop(vs)
    v = decimal.Decimal(v1) + decimal.Decimal(v2)
    v = v / decimal.Decimal(2)
    
    heapq.heappush(vs, v)

print(vs[0])

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

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

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

Solution (Python):

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

v_list.sort()

ans = v_list[0]

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

print(ans)

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

V.sort()

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

print(V[0])

Solution (Python):


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

v = sorted(v)

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

print(x)

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

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

sum = 0
for i, a in enumerate(an):
  sum += a / (2 ** (n-i))
sum += an[0] / (2 ** n)
print(sum)

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

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

print(res)

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

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

Solution (Python):

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

while(len(v)!=2):
    v += [(v.pop(0)+v.pop(0))/2]
    v.sort()
print(sum(v)/2)

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

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

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

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

Solution (Python):
n = int(input())
l = sorted(map(int, input().split()), reverse = True)
c = l.pop()
for i in range(n-1):
    c = (c+ l.pop())/2

print(c)

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

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

nums.sort(reverse=True)

while len(nums) > 2:
    nums.append((nums.pop(-1) + nums.pop(-1)) / 2)
    nums.sort(reverse=True)

print((nums[0]+nums[1])/2)

Solution (Python):
import heapq

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

pq = []
for val in a:
    heapq.heappush(pq, val)

while len(pq) > 1:
    val1 = heapq.heappop(pq)
    val2 = heapq.heappop(pq)
    heapq.heappush(pq, (val1 + val2) / 2)

print(heapq.heappop(pq))

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

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

print(ans)

Solution (Python):









import sys
import re











from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace




def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

n=int(input())
Arr=get_array()
heapify(Arr)
while len(Arr)>1:
    x=heappop(Arr)
    y=heappop(Arr)
    z=(x+y)/2
    heappush(Arr,z)
print(Arr[-1])

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

maximum = v[-1]
v.remove(maximum)
while len(v)!=1:
    tmp = (v[0]+v[1])/2
    v.remove(v[1])
    v.remove(v[0])
    v.insert(0, tmp)

print((maximum + v[0])/2)

Solution (Python):
import heapq
def main():
    n = int(input())
    ls = [int(x) for x in input().split()]
    ls = sorted(ls)
    while 1:
        if len(ls)==1:
            break
        now1 = heapq.heappop(ls)
        now2 = heapq.heappop(ls)
        heapq.heappush(ls,(now1+now2)/2)
    print(ls[0])

if __name__ =="__main__":
    main()

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

vs.sort(reverse=True) 

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

print(sum(v * f for v, f in zip(vs, factor)))

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

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):
import sys
from functools import reduce
input = sys.stdin.readline


def main():
    N = int(input())
    v = list(map(int, input().split()))
    v.sort()
    ans = reduce(lambda a, b: (a+b) / 2, v)

    print(ans)


if __name__ == "__main__":
    main()

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

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

hq = []
for value in v:
    heapq.heappush(hq,value)

while len(hq) != 1:
    v1 = heapq.heappop(hq)
    v2 = heapq.heappop(hq)
    heapq.heappush(hq,(v1+v2)/2)
print(hq[0])

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

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

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

print(v[0])

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

v_list_sorted = sorted(v_list)

for i in range(n - 1):
    top = v_list_sorted.pop(0)
    v_list_sorted[0] = (v_list_sorted[0] + top) / 2

print(v_list_sorted[0])

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


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

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

Solution (Python):



n = int(input())

a = map(int,input().split())
a = sorted(a)
ans = a[0]

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

print(ans)