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

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

V_sum = v[0]/2**(N-1)

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

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

sum_a = input_list[0]

for i in range(input_a):
    sum_a =  sum_a/2 + input_list[i]/2

print(sum_a)

Solution (Python):
N = int(input())
A = list(map(int,input().split()))
A.sort()
x=A[0]
for a in A:
  x = (x+a)/2
print("{}".format(x))

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

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

print((s + v[0] + v[1]) / pow(2,cur))

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

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

v.sort()

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

print(v[0])

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

Solution (Python):




import math
import statistics

def qsort(seq):
  if len(seq) < 1:
      return seq
  pivot = seq[0]
  left = []
  right = []
  for x in range(1, len(seq)):
    if seq[x] <= pivot:
        left.append(seq[x])
    else:
        right.append(seq[x])
  left = qsort(left)
  right = qsort(right)
  foo = [pivot]
  return (left + foo + right)

n  = int(input())
v  = list(int(i) for i in input().split())  
lastguzai = 0.00

for i in range(n):
  vs = sorted(v)
  if len(v) == 2:
    lastguzai = (v[0] + v[1]) / 2.00
    break
  v = vs
  lastguzai = (v[0] + v[1]) / 2.00
  del v[0:2]
  v.append(lastguzai)

print('{:.6f}'.format(lastguzai))

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

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

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

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

while True:
    v.sort()
    tmp = (v[0] + v[1])/2
    v.append(tmp)
    v.pop(0)
    v.pop(0)

    if len(v) == 1:
        print(v[0])
        exit()

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

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

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

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


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

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






myans = (mylist[0]+mylist[1])/2 

for i in range(2, len(mylist)):
    myans = (myans + mylist[i])/2

print(myans)

Solution (Python):


n=int(raw_input())
v=map(int,raw_input().split())
v.sort()
res=v[0]
for i in xrange(1,n):
 res=1.0*(res+v[i])/2
print res

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

Solution (Python):
n = int(input())
v = sorted(list(map(int, input().split())))
ans = 0.5 * sum(v[:2])
if n > 2:
    for i in range(2,n):
        ans = 0.5 * (ans + v[i])
print(ans)

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

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

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


v.sort(reverse=True)

while len(v) >= 2:
    last = v.pop()
    second_last = v.pop()
    new_val = (last + second_last) / 2
    v.append(new_val)

print(v[0])

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

v = input().split()

for i in range(n):
    v[i] = int(v[i])

v.sort()

avg = v[0]

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

print("{}".format(avg))

Solution (Python):
n,*v=map(int,open(0).read().split());v.sort();print(v[0]/2**n+sum(v[i]/2**(n-i)for i in range(n)))

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

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

print(ans)

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

ans=v[0]

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

Solution (Python):
def solve():
  n = int(input())
  v = list(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)
solve()

Solution (Python):
n = int(input())
v = list(map(int, 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()))
while len(v) != 1:
    v.sort()
    v.append((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 v in V[1:]:
    ans = (ans + v) / 2
print(ans)

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

for i in range(1, n-1):
  ans += v.pop(-1)/(2**(i))
  
print(ans)

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

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

foods.sort()

while len(foods) != 1:
    foods[0] = (foods[0] + foods.pop(1)) / 2

print(foods[0])

Solution (Python):
from collections import deque
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
vi = deque(v)
while len(vi) != 1:
	v0 = vi.popleft()
	v1 = vi.popleft()
	vadd = (v0+v1)/2
	vi.appendleft(vadd)
print(vi[0])

Solution (Python):
x=int(input())
l=[]
for x in map(int,input().split()):
    l.append(x)
l.sort()
e=(l[0]+l[1])/2
z=2
while(z<len(l)):
    e=(l[z]+e)/2
    z+=1
print(e)

Solution (Python):
import sys
length = int(input())
sum = 0.0
input_str = list(map(int,input().split(" ")))
input_str.sort();
sum = input_str[0]
for  i in range(1, length):
  sum += input_str[i]
  sum /= 2
  
print(sum);

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

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

Solution (Python):
n = int(input())
l = list(map(int,input().split()))
l.sort()
while len(l)>1:
  x = l.pop(0)
  y = l.pop(0)
  l.append((x+y)/2)
  l.sort()
ans = l.pop()
if ans-int(ans)>0:
  print(ans)
else:
  print(int(ans))

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

values = sorted(V)

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

print(ans)

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

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

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

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

while len(v) != 2:
    v = [(v[0]+v[1])/2] + v[2:]
    n = len(v)
    
print(sum(v)/2)

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

Solution (Python):

from decimal import Decimal
from itertools import permutations


N = int(input())


V = list(map(Decimal, input().split()))

result = 0

V = sorted(V)
result = V[0]

for value in V[1:]:
    result = (result + value) / 2



print(result)

Solution (Python):
import heapq
lens = int(input())
vals = [int(x) for x in input().split()]
heapq.heapify(vals)

while len(vals) > 1:
    curr = heapq.heappop(vals)
    curr += heapq.heappop(vals)
    curr /= 2
    heapq.heappush(vals, curr)
    
print(vals[0])

Solution (Python):
n = int(input())
V = list(map(int, input().split()))
V.sort(reverse=True)
for _ in range(n - 1):
    a, b = V.pop(), V.pop()
    V.append((a + b) / 2)
print(V.pop())

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

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

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

Solution (Python):
import random
num = int(input())
s =list(map(int,input().split()))
s =sorted(s)
a = s[0]

for i in range(num):
  a=(a+s[i])/2
print(a)

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

ans = Lists[0]

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

print(ans)

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+=v[i]
    ans/=2.0

print(ans)

Solution (Python):
def main():
    n = int(input())
    arr = list(map(int,input().split()))
    arr.sort()
    ans = 0
    x = arr[0]
    y = arr[1]
    for i in range(2,len(arr)):
        z = (x+y)/2
        y = arr[i]
        x = z
        

    print((x+y)/2)


main()

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

for i, x in enumerate(v):
    if i == N - 1:
        i = N - 2
    result += x / pow(2, i + 1)

print(result)

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
sv = sorted(v)
mm = sv[-1]
p, ans = 0, 0
if n == 2:
    print(sum(sv)/n)
    exit()
else:
    ans = (sv[0]+sv[1])/2
    p = ans
for x in sv[2:-1]:
    ans = (ans+x)/2
print((ans+mm)/2)

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

for i, x in enumerate(v):
    if i == N - 1:
        i = N - 2
    result += x / pow(2, i + 1)

print(result)

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

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

v.sort()
t = []

for i in range(N):
    if i == 0:
        t.append(v[i])
    else:
        t.append(v[i] * 2**(i-1))

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

Solution (Python):
input()
A=sorted(list(map(int,input().strip().split(' '))))
temp=A[0]
for i in range(1,len(A)):
    temp=(temp+A[i])/2
print(temp)

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

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

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

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

def mix( a, b ):
  return ( a + b ) / 2.0

v = mix( gu[0], gu[1])
for i in range( 2, len( gu )):
  v = mix( gu[i], v )

print(v)

Solution (Python):
import sys, math, itertools, bisect, copy, re

from collections import Counter, deque, defaultdict
from itertools import accumulate, permutations, combinations, takewhile, compress, cycle
from functools import reduce
from math import ceil, floor, log10, log2, factorial
from pprint import pprint


input = sys.stdin.readline

INF = float('inf')
MOD = 10 ** 9 + 7
EPS = 10 ** -7
sys.setrecursionlimit(1000000)

N = int(input())
V = [int(x) for x in 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())
aryNum = list(map(int, input().split()))

while (len(aryNum) > 1):
    """ 公式ドキュメントと提出サンプルを参考に
    aryNum.sort()
    a = aryNum[0]
    b = aryNum[1]
    aryNum.remove(a)
    aryNum.remove(b)
    """
    aryNum.sort(reverse=True)
    a = aryNum.pop()
    b = aryNum.pop()

    aryNum.append((a + b) / 2)

print(aryNum[0])

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

Solution (Python):
N = int(input())
v = [int(x) for x in input().split()]
v.sort()
ans = 0
for ind,i in enumerate(v[1:]):
    if(ind==0):
        ans = (v[0]+v[1])/2
    else:
        ans = (ans+i)/2
print(ans)

Solution (Python):
import math
N = int(input())
v = list(map(int,input().split()))
v_new = 0

a = 0
k = []

p = N
for i in range(N-1):
    
    if v.count(v[0]) == p:
        break
    else:
       x = min(v)
       v.remove(x)
       
       y = min(v)
       v_new = (x+y)/2
       
       v.append(v_new)
       
       v.remove(y)
       
       v_new = 0
       
       p = p-1
       a = 0
       x = 0
       y = 0
print(v[0])

Solution (Python):
N=int(input())
v = list(map(float,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()))
count=N
v.sort()
while count>1:
    v[0] = (v[0]+v[1])/2
    del v[1]
    count-=1
print(v[0])

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

for _ in range(n-1):
  l[0] = (l[0] + l[1]) / 2
  del l[1]
  l = sorted(l)

print(l[0])

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

Solution (Python):
N = int(input())
v = list(map(int, input().split()))
import heapq
def heapsort(iterable):
    h = []
    for value in iterable:
        heapq.heappush(h, value)
    return [heapq.heappop(h) for i in range(len(h))]
heap = heapsort(v)
result = heap[0]
for k in range(1, N):
  result = (result+heap[k])/2
print(result)

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

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

arr.sort()

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

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

for i in range(2, n):
    lv[i] = lv[i] * (2 ** (i-1))

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

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

s = 0
for i in range (0,n-2):
  i = 0
  v = sorted(v)
  s = (v[i]+v[i+1])/2
  v.append(s)
  del v[0:2]

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

Solution (Python):
import numpy as np

n = int(input())
s = np.array(sorted(list(map(int, input().split()))))
a = 2 ** np.arange(1,n)[::-1]
a = np.append(a[0], a)


print(sum(s/a))

Solution (Python):
_,v=open(0)
s,*v=sorted(map(int,v.split()))
for i in v:s=(s+i)/2
print(s)

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

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

print (V[0])

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

Solution (Python):



import sys
input = sys.stdin.readline


def main():
    n = int(input())
    v = list()

    for i in map(int, input().split()):
        v.append(i)

    v.sort()

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

    print(ans)


if __name__ == '__main__':
    main()

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

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

print(round(ans,6))

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

arr.sort()

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

print(temp)

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

Solution (Python):
from collections import deque,defaultdict,Counter
from itertools import accumulate
import bisect
from heapq import heappop,heappush
from fractions import gcd
from copy import deepcopy
import math
import queue

Mod = 1000000007




def main(): 
    N = int(input())
    v = list(map(int,input().split()))
    v.sort()
    a = (v[0]+v[1])/2
    if N == 2:
        print(a)
        exit()
    for i in range(2,N):
        a = (a+v[i])/2
    print(a)

if __name__ == "__main__":
    main() 





def sieve_of_eratosthenes(n):
    if not isinstance(n,int):
        raise TypeError("n is not int")
    if n<2:
        raise ValueError("n < 2 is not effective")
    prime = [1]*(n+1)
    for i in range(2,int(math.sqrt(n))):
        if prime[i] == 1:
            for j in range(2*i,n):
                if j%i == 0:
                    prime[j] = 0
    res = []
    for i in range(2,n):
        if prime[i] == 1:
            res.append(i)
    return res

class UnionFind:
    def __init__(self,n):
        self.parent = [i for i in range(n+1)]
        self.rank = [0 for i in range(n+1)]
    
    def findroot(self,x):
        if x == self.parent[x]:
            return x
        else:
            y = self.parent[x]
            y = self.findroot(self.parent[x])
            return y
    
    def union(self,x,y):
        px = self.findroot(x)
        py = self.findroot(y)
        if px < py:
            self.parent[py] = px
        else:
            self.parent[px] = py

    def same_group_or_no(self,x,y):
        return self.findroot(x) == self.findroot(y)

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

Solution (Python):
N = int(input())
u = list(map(int,input().split()))
s_u = sorted(u)
for x in range(N-1):
  s_u = sorted(s_u)
  tmp = s_u.copy()
  val = (tmp[0] + tmp[1]) / 2
  if len(s_u) != 1:
    s_u.remove(tmp[0])
    s_u.remove(tmp[1])
  s_u.insert(0,val)
print(s_u[0])

Solution (Python):
from bisect import insort

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

v.sort()
while len(v) > 1:
    x = v.pop(0)
    y = v.pop(0)
    insort(v, (x + y) / 2)

print(v[0])

Solution (Python):
num = int(input())
lists = sorted(map(int, input().split()))[::-1]

tmp = 0.0

for _ in range(num - 1):
    x = lists.pop()
    y = lists.pop()
    lists.append((x + y) / 2)

print(lists[0])

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


V.sort()

result = V[0]

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

print(result)

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

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

print(temp)

Solution (Python):
n=int(input())
l=list(map(int,input().split()))
l.sort()
b=l.pop(0)
for i in l:
  b=(b+i)/2
print(b)

Solution (Python):
n=int(input())
m=input().split()

int_m=[]
tmp =0

for x in m:
  int_m.append(int(x))
  
int_m.sort()
for y in range (0,len(int_m)):
  tmp+=int_m[y]
  if y !=0:
    tmp /= 2
print(tmp)

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

Solution (Python):
import numpy as np

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

a_sorted = sorted(a)

result = a_sorted.pop(0)
while a_sorted:
    a = a_sorted.pop(0)
    result = sum([a, result]) / 2
    if not a_sorted:
        print(result)

Solution (Python):

N = int(input())
vs  = sorted(list(map(int, input().split())))
ans = 0
ans = vs[0]+vs[1]
for i,v in enumerate(vs[2:]):
    ans += v*2**(i+1)
ans/=2**(N-1)
print(ans)

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

value.sort()
for i in range(n):
    if(i <= 1):
        continue
    value[i] = value[i] * pow(2, i-1)

con = sum(value) / pow(2, n-1)
print(con)

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

Solution (Python):
from functools import reduce

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

print(reduce(lambda r, v: (r + v) / 2, vs))

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

A.sort()

count = 0
X = 0


for i in A:
  if count == 0:
    count += 1
    X += i
    continue
  else:
    X = (X + A[count]) / 2
    count += 1

print(X)

Solution (Python):


N = input()
N = int(N)

v = []
v = input().split()

v = [float(n) for n in v]

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

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

print (V[0])

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

Solution (Python):
N = int(input())
u = list(map(int,input().split()))
s_u = sorted(u)
for x in range(N-1):
  s_u = sorted(s_u)
  tmp = s_u.copy()
  val = (s_u[0] + s_u[1]) / 2
  if len(s_u) != 1:
    s_u.remove(tmp[0])
    s_u.remove(tmp[1])
  else:
    s_u.remove(tmp[0])
  s_u.insert(0,val)
print(s_u[0])

Solution (Python):
a = int(input())
b= [int(s) for s in input().split()]
b=sorted(b)

t = (b[0] + b[1])/2

if a!=2:
	for i in range(a-2):
  		k = (t + b[i+2])/2
  		t=k

print(t)

Solution (Python):
def val(x,y):
    return (x + y) /2

n=input()
v=[int(x) for x in list(input().split())]
v.sort()
value=v[0]
for i in range(len(v)-1):
    value=(v[i+1]+value)/2

print(value)

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

sv = sorted(v)

for i in range(n-1):
    new = (sv[0] + sv[1]) / 2
    if(i == n-1):
        break
    
    else:
        sva = sv[2:]
        sva.append(new)
        sv = sorted(sva)

print(sv[0])

Solution (Python):
N = int(input())
v = input().split()
v.sort(key=float)

i = 0
while i <= N-2:
  v[i+1]=(float(v[i])+float(v[i+1]))/2
  i += 1
  

print(v[i])

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


v = [float(s) for s in raw_input().split()]

for i in range(len(v) - 1):
    v.sort(reverse=True)
    _mean = (v.pop() + v.pop())/2.0
    v.append(_mean)

print(v[0])

Solution (Python):



N = int(raw_input())


li = map(int, raw_input().split())


li.sort(reverse=True)


for i in xrange(N-1,0,-1):
    tmp = float(li.pop(i) + li.pop(i-1))/2
    li.append(tmp)

print tmp

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

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

print(ans)

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

from heapq import heappush, heappop

h = []
for a in v:
    heappush(h, a)

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

print(h[0])

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

while len(num) >= 2:
  num.sort()
  num.append((num.pop(0) + num.pop(0))/2)
print(num[0])

Solution (Python):
num = int(input())
lines = input().split(" ")
int_lines = [int(i) for i in lines]
int_lines.sort()
count = 1
 
if num == 2:
  result = (int_lines[0] + int_lines[1]) / 2
  print(result)
else:
  itr = iter([j for j in int_lines])
  for j in itr:
    if count == 1:
        x = j
        count += 1
    elif count == 2:
        y = j
        count += 1
    else:
        x = (x + y) / 2
        y = j
        count += 1
  x = (x + y) / 2
    
  print(x)

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



for i in range(N-1):

    Vs.sort()
    a = Vs.pop(0)
    b = Vs.pop(0)
    Vs.append((a+b)/2)

print(Vs[0])

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

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

print(v[0])

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

sv = sorted(v)

ans = 0

for i in range(N-1):
  if i == 0:
    ans = (sv[i] + sv[i+1]) / 2
  else:
    ans = (sv[i+1] + ans) / 2

print(ans)

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

for i in range(N):
    v[i] = float(v[i])
    
v.sort()
ite = 0
while(ite < N-1):
    v[ite+1] = (v[ite]+v[ite+1])/2
    v[ite] = 0
    v.sort()
    
    ite += 1

print(v[-1])

Solution (Python):



n = int(input())
numbers = map(int, input().split())

ans = [[0] * n for i in range(n)]

numbers = sorted(numbers, reverse=False)

for x, i in enumerate(numbers):
    ans[0][x] = i 




for x, ansc in enumerate(ans):
    
    
    if ansc.count(0) == n - 1:
        print(ansc[n-1])
        break
    for y, i in enumerate(ansc):
        if i != 0 and y == 0:
            
            ansc[1] = (float(ansc[0]) + ansc[1]) / 2
            ansc[0] = 0
            break
        else:
            
            if y > 0:
                if ansc[y-1] == 0 and ansc[y] != 0:
                    ansc[y+1] = (float(ansc[y]) + ansc[y+1]) / 2
                    ansc[y] = 0
                    break
        
        
        
    
    
    ans[x+1] = sorted(ans[x+1], reverse=False, key=float)
    ans[x+1] = ansc

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

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

ev = 0
count = 1

while count > 0:
  count = 0
  i = 0
  while i+1 in range(row):
    if array[i] > array[i+1]:
      ev = array[i] 
      array[i] = array[i+1]
      array[i+1] = ev
      count += 1
    else:
      i += 1

i = 0
Ans = array[i]
while i < row:
  if i == 0:
    Ans = array[i]
  else:
    Ans = (Ans + array[i]) / 2
  i += 1

print(Ans)

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

v.sort()

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

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

Solution (Python):
def alche(n, v):
    if n == 2:
        x = (v[0] + v[1]) / 2
        print(x)
    else:
        v.sort()
        w = []
        w.append((v[0] + v[1]) / 2)
        for i in range(2, n):
            w.append(v[i])
        n -= 1
        alche(n, w)

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

alche(n, v)

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

Solution (Python):
def solve():
    v = read()
    result = think(v)
    write(result)


def read():
    n = read_int(1)[0]
    return read_int(n)


def read_int(n):
    return list(map(lambda x: int(x), read_line().split(' ')))[:n]


def read_float(n):
    return list(map(lambda x: float(x), read_line().split(' ')))[:n]


def read_line(n=0):
    if n == 0:
        return input().rstrip()
    else:
        return input().rstrip()[:n]


def think(v):
    local_v = list(v)
    local_v.sort()
    return recursive_call(local_v, 0, len(local_v) - 1, {})


def recursive_call(vector, from_index, to_index, cache):
    
    key = '{0:d},{1:d}'.format(from_index, to_index)
    if key in cache:
        return cache[key]
    if to_index - from_index <= 1:
        value = (vector[from_index] + vector[to_index]) / 2
        cache[key] = value
        return value
    merged_vector = list(vector)
    elem_1 = merged_vector.pop(from_index)
    elem_2 = merged_vector.pop(from_index)
    merged_vector.insert(from_index, (elem_1 + elem_2) / 2)

    value_1 = recursive_call(merged_vector, from_index, to_index - 1, cache)
    value_2 = (elem_1 + recursive_call(vector, from_index + 1, to_index, cache)) / 2
    result = max(value_1, value_2)
    cache[key] = result

    return result


def write(result):
    print(result)


if __name__ == '__main__':
    solve()

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

*V, = map(int, input().split())

V.sort(reverse=True)

dp = [0]*N



for i in range(N-1):
    z = (V[len(V)-2]+V[len(V)-1])/2
    dp[i+1] = dp[i] + z
    
    
    V.pop()
    V.pop()
    V.append(z)
    V.sort(reverse=True)



print(V[0])