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 math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]
def mi(n): return [wi() for _ in range(n)]
def num__grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

n = i()
v = wi()
v.sort()
k = v[0]

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

print(k)

Solution (Python):
N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])

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

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

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

result=V[0]
for v in V[1:]:
    result=(result+v)/2
    
print(result)

Solution (Python):
n = int(input())
v = list(map(int,input().split()))
i = len(v)-1

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

print(new_num)

'''
    for j in range((n-1)-i):
        if j == 0:
            v[j] = new_num
        else:
            v.remove(v[len(v)-1])

'''

Solution (Python):
def resolve():
    n = int(input())
    v = sorted(list(map(int, input().split())))
    while len(v) > 2:
        new_v = [sum(v[:2]) / 2] + v[2:]
        v = new_v
    print(sum(v) / 2)


if __name__ == "__main__":
    resolve()

Solution (Python):
import functools

_, v = int(input()), sorted(map(int, input().split()))
v_max = functools.reduce(lambda a, b: (a + b) / 2, v, v[0])
print(v_max)

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

v = list(map(int,input().split()))
         
if N == 2:
  print(sum([int(i) for i in v])/2)
  exit()
  
else:
  v.sort()
  a = v[-1]
  v.pop(-1)
  r = (v[0]+v[1])/2
  for i in range(N-3):    
    r = (r+v[i+2])/2 
    
print((r+a)/2)

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

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

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

ans = V[0]

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

print(ans)

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

V.sort()
V_sum = (V[0] + V[1]) / 2

if N != 2:
  for i in range(2, N):
    V_sum = (V_sum + V[i]) / 2

print(V_sum)

Solution (Python):
n=int(input())
v=list(map(int,input().split()))
v.sort(reverse=True)
ans=v.pop()
while v:
  tmp=v.pop()
  ans=(ans+tmp)/2

print(ans)

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

    
print(max(v_list))

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

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

Solution (Python):
n = int(input())
v = input().split()
v = [int(i) for i in v]
v.sort()
while len(v) > 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()))

v.sort()

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

Solution (Python):

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

v_list.sort(reverse=True)

for i in range(len(v_list) - 1):
    append_num = (v_list.pop() + v_list.pop()) / 2
    v_list.append(append_num)

print(v_list[0])

Solution (Python):
n = int(input())
v_s = [int(a) for a in input().split()] 

v_s.sort()

first = True
for v in v_s:
  if first:
    ans = v
    first = False
  else:
    ans = (v + ans) / 2
    
print(ans)

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

print(ans)

Solution (Python):
N = int(input())
A = sorted(list(map(int, input().split())))
l = []

for i in range(N):
  l.append(2**(i+1))

l = sorted(l, reverse = True)
  
array_multiple = list(map(lambda x,n: x/n, A, l))

print(sum(array_multiple)+A[0]/(2**N))

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):
input()
A = list(map(int, input().split()))
A.sort()
while len(A)>1:
  b = A[0:2]
  c = sum(i for i in b)
  A.append(c/2)
  del(A[0:2])
  A.sort()
z = [str(a) for a in A]
z = ''.join(z)
print(z)

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

for i in range(N):
    if len(v) == 1:
        pass
    else:
        if min(v) in v:
            aaa =min(v)
            v.remove(min(v))
        if min(v) in v:
            bbb =min(v)
            v.remove(min(v))
            ccc =(aaa + bbb)/2
            v.append(ccc)
print(v[0])

Solution (Python):


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

v.sort(reverse=False)

temp = v[0]

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

print(temp)

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

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

print(tmp)

Solution (Python):
import sys
N = int(input())
v = list(map(int,input().split()))
max_num = max(v)
v.remove(max(v))

if N >2:
	x = min(v)
	v.remove(min(v))
	y = min(v)
	v.remove(min(v))
	value = (x+y)/2
	
	while len(v) != 0:
		target = value
		value = (value+min(v))/2
		
		v.remove(min(v))

	print((value+max_num)/2)
	sys.exit()

else:
	print((max_num+v[0])/2)
	sys.exit()

Solution (Python):
n = int(input())
v = list(map(int, input().split()))
 
for i in range(n-1):
  mn1 = min(v)
  v.remove(min(v))
  mn2 = min(v)
  v.remove(min(v))
  v.append((mn1 + mn2) / 2.0)
 
print(v[0])

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

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

for i in range(n - 1):
    v[-2] += v[-1]
    v[-2] /= 2
    v.pop(-1)
    v.sort(reverse=True)

print(v[0])

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

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

Solution (Python):
N_number = int(input())
values = list(map(int,input().split()))
values.sort()
for i in range(N_number-1):
  new_value = (values[0]+values[1]) / 2
  values = values[2:]
  values.insert(0, new_value)

print(values[0])

Solution (Python):
n=int(input())
nu=list(map(int,input().split()))
num=sorted(nu)
a=num.pop(0)
b=num.pop(0)
c=(a+b)/2
for i in range(n-2):
    x=num.pop(0)
    c=(c+x)/2
print(c)

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

li.sort()
a = li[0] 

if n >=2:
    for i in range(1,n-1):
        a = (a + li[i])/2
        
print((a+li[-1])/2)

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

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

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

print(V[0])

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

v.sort()

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

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

print(temp)

Solution (Python):
import heapq

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

heapq.heapify(v)
while len(v) > 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()))
v2 = sorted(v)
S = v2[0]/2**(N-1)
for i in range (N-1):
  S += v2[i+1]/2**(N-1-i)
print(S)

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

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

def saiki(*v):
    
    if len(v) == 1:
        return v
    elif len(v) == 2:
        return sum(v)/2
    else:
        return (saiki(*v[1:]) + v[0])/2

print(saiki(*v))

Solution (Python):
n=input()
arr=map(float,raw_input().split())
if n==2:
        print (arr[0]+arr[1])/2
else:
        arr.sort()
        tot=arr[0]+arr[1]
        c=2
        for i in range(2,n):
                tot+=c*arr[i]
                c*=2
        print tot/pow(2,n-1)

Solution (Python):
from functools import reduce
n = int(input())

v = sorted(map(int, input().split()))
ans = reduce(lambda a, b: (a+b)/2, v)
print(ans)

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

V.sort()
t = 0.0

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

print(V[0])

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

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


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

Solution (Python):
import heapq


def solve(N, v):
    h = v[:]
    heapq.heapify(h)
    while len(h) > 1:
        x = heapq.heappop(h)
        y = heapq.heappop(h)
        
        heapq.heappush(h, (x + y) / 2)
    return h[0]


def main():
    N = int(input())
    v = [int(x) for x in input().split()]
    print(solve(N, v))


if __name__ == "__main__":
    main()

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

while len(v) != 1:
    mx = min(v)
    v.remove(min(v))
    mn = min(v)
    v.remove(min(v))
    v.append((mx+mn)/2)
print(v[0])

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

print(ave)

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

def cal(v):
  if len(v) == 1:
    return v[0]
  else:
    vv = v
    vv.sort()
    vv.reverse()
    vv_max = vv[0]
    vv.pop(0)
    return (cal(vv)+vv_max)/2

print(cal(v))

Solution (Python):
n = input()

gu = [int(e) for e in input().split()]

gu.sort()

gunew = gu[0]

for i in gu :
    gunew = (gunew + i) / 2

print(gunew)

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

v_new = sorted(v)

while len(v_new) > 1:
 	v_new[0] = ((v_new[0] + v_new[1]) / 2)
 	
 	for i in range(len(v_new) - 2):
 		v_new[ i + 1 ] = v_new[ i + 2 ]

 	
 	del v_new[-1]	

print(v_new[0])

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

v.sort(reverse=True)

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

print(v[0])

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

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

Solution (Python):
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)



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

answer = 0
V.sort(reverse = True)
while len(V) > 1:
    x = V.pop()
    y = V.pop()
    V.append((x+y)/2)
answer = V[0]
print(answer)

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


for i in range(N-1):
    a1 = V.pop()
    a2 = V.pop()
    V.append( (a1+a2) /2)
    V.sort(reverse=True)

print(V.pop())

Solution (Python):
n = int(input())
list = [int(i) for i in input().split()]
list.sort()
x = 0

for i in list:
  if x == 0:
    x = i
  else:
    x = (x + i)/2
print(x)

Solution (Python):
n = input()
nums_str = input()
num_str_list = nums_str.split(" ")
num_list = list(map(lambda x: int(x), num_str_list))
num_list.sort()

temp = num_list[0]
num_list.pop(0)
for num in num_list:
    temp += num
    temp /= 2

print(temp)

Solution (Python):
A = int(input())
B = list()
tmp = 0

B= input().split()
C = list(map(int, B))
D = sorted(C)

tmp = D[0]

for i in range(A-1):
    tmp = (tmp + D[i+1])/2
print(tmp)

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

v_sorted = sorted(v)
average = 0

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

print(v_sorted[-1])

Solution (Python):
N=int(input())
As=[float(x) for x in input().strip().split(" ")]
As=sorted(As)
def mix(As):
    if len(As) == 2:
        return (As[0] + As[1])/2
    a=As.pop()
    return (a+mix(As))/2
print(mix(As))

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

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

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

v_l.sort()

bunshi=v_l[0]
bunbo=2**(n-1)


for i in range(1,n):
    bunshi += v_l[i]*(2**(i-1))
    
print(bunshi/bunbo)

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 = input("").split(" ")
for i in range(n):
    v[i] = int(v[i])
v.sort()
while len(v) != 1:
    new_value = (v[0] + v[1]) / 2
    v.append(new_value)
    v.remove(v[0])
    v.remove(v[0])
    v.sort()

print(v[0])

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

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

temp = 0
sum_ = 0

for i in range(1,n):
    if i == 1:
        temp += decimal.Decimal((v[0] + v[1])/2)
    else:
        temp = decimal.Decimal((temp + v[i])/2)

print(temp)

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

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

Solution (Python):
from collections import deque

N = int(input())
v = list(map(int, input().split()))
v.sort()
V = deque(v)
sum = 0
while True:
    sum = (V.popleft() + V.popleft())/2
    V.appendleft(sum)
    if len(V) == 1:
        break

print(V[0])

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

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

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

v.sort()

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

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

print(ans)

Solution (Python):
import heapq

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

heapq.heapify(q)

while (len(q) > 1):
    v1 = heapq.heappop(q)
    v2 = heapq.heappop(q)
    heapq.heappush(q, (v1+v2)/2.0)

print(heapq.heappop(q))

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

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


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

Solution (Python):


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

v = sorted(v)
a = v.pop(0)
b = v.pop(0)

result = (a + b)/2
while len(v) > 0:
    a = v.pop(0)
    b = result
    result = (a + b)/2

print(result)

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

for i in range(0,N-1):
    Ave=float((V[0]+V[1])/2)
    V.pop(0)
    V.pop(0)
    V.append(Ave)
    V=sorted(V)
print(V[0])

Solution (Python):
import math
n = int(input())
ni = [float(e) for e in input().split()]
ni.sort()
result = float(ni[0]+ni[1])/2.0

if n > 2:
	for i in range(2,n):
		result = float(result+ni[i])/2.0
	
print(result)

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

Solution (Python):
N = int(input())
A = sorted(list(map(int,(input().split()))))
i = 1
ans = A[0]

while i < N:
    ans = (A[i] + ans) / 2
    i += 1

print(ans)

Solution (Python):
import sys
inputs = sys.stdin.readlines()

n = int(inputs[0])
v_list = list(map(int, inputs[1].split()))
v = sorted(v_list)

for _ in range(len(v)-1):
    val = (v[1] - v[0]) / 2
    val = (v.pop(0) + v.pop(0)) / 2
    v.insert(0, val)
print(val)

Solution (Python):

import sys
def main():
    N = int(input())
    lists = list(map(float, input().split()))
    lists.sort()

    for i in range(N-1):
        new_guzai = (lists[0] + lists[1]) / 2.0

        for _ in range(2):
            lists.pop(0)

        lists.append(float(new_guzai))
        lists.sort()
        if len(lists) ==1:
            print(lists[0])
            sys.exit()


if __name__ == '__main__' :
    main()

Solution (Python):
N = int(input())
V = list(map(int,input().split()))
X = []
for i in range(N):
  X.append(V[i]-min(V))
def cal(V):
  A = 0
  for i in range(1,N+1):
    A += (sorted(V)[-i])/(2**(i))
  return A
print(cal(X) + min(V))

Solution (Python):

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

 
  
print(float(v[0]))

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

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


for i in range(N-1):
    A[1] = (A[0] + A[1]) / 2
    A.pop(0)
    A = sorted(A)
    
print(A[0])

Solution (Python):
from copy import deepcopy
from sys import exit,setrecursionlimit
import math
from collections import defaultdict,Counter,deque
from fractions import Fraction as frac

setrecursionlimit(1000000)


def main():
	n = int(input())
	v = list(map(int,input().split()))
	v.sort(reverse = True)
	for i in range(n-1):
		a = v.pop()
		b = v.pop()
		v.append((a+b)/2)
	print(v[0])

def zip(a):
	mae = a[0]
	ziparray = [mae]
	for i in range(1,len(a)):
		if(mae != a[i]):
			ziparray.append(a[i])
			mae = a[i]
	return ziparray

def is_prime(n):
	if n < 2: return False

	for k in range(2, int(math.sqrt(n)) + 1):
		if n % k == 0:
			return False

	return True

def list_replace(n,f,t):
	return [t if i==f else i for i in n]

def base_10_to_n(X, n):
	X_dumy = X
	out = ''
	while X_dumy>0:
		out = str(X_dumy%n)+out
		X_dumy = int(X_dumy/n)
	if(out == ''): return '0'
	return out

def gcd(l):
	x = l.pop()
	y = l.pop()
	while(x%y!=0):
		z = x%y
		x = y
		y = z
	l.append(min(x,y))
	return gcd(l) if len(l) > 1 else l[0]

class Queue():
	def __init__(self):
		self.q = deque([])
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.popleft()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class Stack():
	def __init__(self):
		self.q = []
	def push(self,i):
		self.q.append(i)
	def pop(self):
		return self.q.pop()
	def size(self):
		return len(self.q)
	def debug(self):
		return self.q

class graph():
	def __init__(self):
		self.graph = defaultdict(list)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
		self.graph[t].append(f)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
		self.graph[t].remove(f)
	def linked(self,f):
		return self.graph[f]

class dgraph():
	def __init__(self):
		self.graph = defaultdict(set)
	def addnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].append(t)
	def rmnode(self,l):
		f,t = l[0],l[1]
		self.graph[f].remove(t)
	def linked(self,f):
		return self.graph[f]

main()

Solution (Python):
n = int(input())
v_list = [int(x) for x in input().split()]
v_list.sort()
while len(v_list) > 1:
    a = v_list.pop(0)
    b = v_list.pop(0)
    v_list.insert(0, (a + b) / 2)
print(v_list[0])

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

Solution (Python):


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

v.sort()

sum  = v[0]
for w in v[1:]:
    sum = (sum + w) / 2

print(sum)

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

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

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

print(result)

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

summax=0.0
for i in range(N-1):
    summax=summax+sortedV[i]/pow(2.0,i+1)
summax=summax+sortedV[N-1]/pow(2.0,N-1)

print(summax)

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

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

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

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

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

V = list()
V = values.split()
V_num = list()

for i in range(N):
    V_num.append(float(V[i]))

V_num.sort()

for i in range(N-1):
    min1 = V_num.pop(0)
    min2 = V_num.pop(0)
    V_num.append((min1+min2)/2)
    V_num.sort()

print(V_num[0])

Solution (Python):
from functools import reduce
n = int(input())
v = reduce(lambda x, y: (x + y) / 2, sorted(map(int, input().split())))
print(v)

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

Solution (Python):




import math
import statistics


def fact(n):
  if(n == 1):
    return 1
  else:
    return (n * fact(n - 1))


def gcd(a,b):
  if a == 0:
    return b
  elif b == 0:
    return a
  else:
    return gcd(b,a % b)


def lcm(a,b):
  return (a * b / gcd(a,b))


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]
  del v[0]
  
  v.append(lastguzai)
  

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

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

if n == 2:
    b, c = map(int, input().split())
    print((b + c) / 2)
else:
    s = list(map(int, input().split()))
    s.sort()
    k = s[0] / 2 ** (n - 1)
    for i in range (1, n):
        k = k + s[i] / 2 ** (n - i)
    
    print(k)

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

while n > 1:
	list = []
	for i in range(n-1):
		for j in range(i+1, n):
			sum = (v[i] + v[j])/2
			for k in range(n):
				if k != i and k != j:
					sum += v[k]
			list.append([i, j, sum])
	list.sort(key=lambda x : x[2])
	list.reverse()
	v[list[0][0]] = (v[list[0][0]]+v[list[0][1]])/2
	v[list[0][1]] = v[n-1]
	n -= 1
print(v[0])

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

Solution (Python):
n = input()
vList = list(map(int, input().split()))
vList.sort()
s = sum(vList)
while len(vList) > 1:
    t = (vList[0] + vList[1]) / 2
    vList.pop(0)
    vList[0] = t
    s -= t
print(vList[0])

Solution (Python):
import numpy as np

N = input()
N = int(N)
stN = str(N)
p = input().split()
p_l = [int(s) for s in p]

p_sort = sorted(p_l,reverse=True)

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

print(p_sort[0])

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.0

print(v[n-1])

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

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

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

V.sort()
result = 0
for i in range(1,len(V)):
    if i == 1:
        result = (V[0] + V[1])/2
    else:
        result = (result + V[i])/2

print(result)

Solution (Python):
def A():
    a = int(input())
    s = str(input())
    if a<3200:
        print('red')
    else:
        print(s)

def B():
    n = int(input())
    a = input().split()
    s = 0
    for i in range(n):
        s += (1/int(a[i]))
    print(1/s)

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

    if n == 2:
        print((v[0]+v[1])/2)
        return

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

    print(v[-1])

C()

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

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

for i in range(n-1):
    a = min(arr)
    arr.remove(a)
    b = min(arr)
    arr.remove(b)
    arr.append((a+b)/2)
    
print(*arr)

Solution (Python):

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

v_list_sorted = sorted(v_list)

sum = 0
tmp_min = 0

if N == 1:
    print(v_list[0])
    exit(0)

for i in range(0, N - 1):
    if i == 0:
        merged = (v_list_sorted[i] + v_list_sorted[i + 1]) / 2.0
        tmp_min = merged
        sum = merged
    else:
        tmp_min = (tmp_min + v_list_sorted[i + 1]) / 2.0
print(tmp_min)

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 = list(map(int, input().split()))
tmp = 0
v.sort()

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

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

print(tmp)

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

v.sort()

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

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

print(a)

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

V.sort()
sum = V[0]
for i in range(1,N):
    sum += V[i] * 2**(i-1)

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

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

for i in range(n - 1):
    li.sort(reverse=True)
    small1 = li.pop()
    small2 = li.pop()
    li.append((small1 + small2) / 2)
print(li[0])

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

print(ans)

Solution (Python):
N = int(input())
list = list(map(int, input().strip().split()))
      
for i in range(1, N):
    if len(list)>1:
        list.sort()
        list.append((list[0] + list[1]) / 2)
        del list[:2]

print(list[0])