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):
def actual(N, V):
    
    V.sort(reverse=True)

    while len(V) != 1:
        first_small = V.pop()
        second_small = V.pop()

        new_value = (first_small + second_small) / 2

        V.append(new_value)

    return V[0]

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

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

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

if len(V) == 2:
  print((V[0]+V[1])/2)
else:
  ans = 0
  for i in range(n-1):
    ans += V[i]/(2**(i+1))
  ans += V[n-1]/(2**(n-1))
  print(ans)

Solution (Python):

import sys


buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


@mt
def slv(N, V):
    V.sort(reverse=True)
    from fractions import Fraction
    while len(V) > 1:
        a = V.pop()
        b = V.pop()
        V.append(Fraction(a+b, 2))
    return float(V[0])





def main():
    N = read_int()
    V = read_int_n()
    print(slv(N, V))


if __name__ == '__main__':
    main()

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

V.sort()
now=V[0]

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

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

vlist.sort()

sum=0
for i,v in enumerate(vlist):
    if i == 0:
        sum += v
    else:
        sum += (2**(i-1)) * v
print(sum / (2**(n-1)))

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

Solution (Python):
import sys
from math import pi, cos, sqrt
from collections import defaultdict
readline = sys.stdin.buffer.readline



def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    N = gete(int)
    v = list(geta(int))
    v.sort()

    base = 1

    ans = v[0]
    for vi in v[1:]:
        ans += vi * base
        base *= 2

    print(ans / base)


if __name__ == "__main__":
    main()

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

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

print(ans)

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

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

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

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

print(*A)

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

def mergesort(a):
    def _merge_sort(a, left: int, right: int):
        if left < right:
            center = (left+right)//2

            _merge_sort(a,left,center)
            _merge_sort(a,center+1,right)

            
            p=j=0
            i=k=left

            
            while i <= center:
                buff[p]=a[i]
                p+=1
                i+=1

            
            while i<= right and j < p:
                if buff[j] <= a[i]:
                    a[k]=buff[j]
                    j+=1
                else:
                    a[k]=a[i]
                    i+=1
                k+=1

            while j < p:
                a[k] =buff[j]
                k+=1
                j+=1

    n=len(a)
    
    buff=[None]*n
    _merge_sort(a,0,n-1)
    del buff

mergesort(v)

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

print(v[n-1])

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

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

print(total)

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

v = sorted(v, reverse=True)
ans = 0

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

ans += v[n-1] / time

print(ans)

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

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

from functools import reduce
n = int(input())
v = sorted(list(map(int, input().split())))
def flat(x,y):
    return (x+y)/2
print(reduce(flat, v))

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

v.sort(reverse=True)

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

ans+=v[N-1]/(2**(i+1))

print(ans)

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

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

Solution (Python):
N = int(input())
vn = sorted(list(map(int,input().split())))
for n in range(N-1):
  vn[n+1] = (vn[n]+vn[n+1])/2

print(vn[N-1])

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

Solution (Python):
n=int(input())
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):
import bisect

def main():
    N = int(input())
    v = sorted(list(map(int, input().split())))
    while len(v) > 1:
        num1 = v.pop(0)
        num2 = v.pop(0)
        avg = (num1 + num2) / 2
        idx = bisect.bisect(v, avg)
        v.insert(idx, avg)
    print(v[0])
main()

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


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

print(v[0])

Solution (Python):
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
ans=0
x=a.pop(0)
y=a.pop(0)
ans=(x+y)/2
while(len(a)!=0):
    ans=(ans+a.pop(0))/2
print(ans)

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

ans = 0

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

print(ans)

Solution (Python):
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
t=ii()
a=ll()
a.sort()
ans=a[0]
for i in range(1,t):
    ans=(ans+a[i])/2
print(ans)

Solution (Python):




import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter












N = int(input())
V = list(map(int, 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 = sorted(v)

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

print(V[-1])

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

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

nums.sort()
value = nums[0]
for i in range(1, n):
    value = (value + nums[i])/2

print(value)

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

Vs.sort()



initialGousei = (Vs[0] + Vs[1]) / 2

for i in range(2, N):
    initialGousei = (initialGousei + Vs[i]) / 2

print(initialGousei)

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

V = sorted(V)

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

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

v.sort()



while len(v) > 2:
    v.append((v[0] + v[1]) / 2)
    v.remove(v[0])
    v.remove(v[0])
    v.sort()
    

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

Solution (Python):
def main() -> None:
    _ = int(input())
    V = [int(x) for x in input().split()]
    V.sort()
    ans = V[0]
    for v in V[1:]:
        ans = (v + ans) / 2
    print("{:.15f}".format(ans))


if __name__ == '__main__':
    main()

Solution (Python):

from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor


def main():
    
    

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


    for i in range(N-1):
        Vs = sorted(Vs)
        two = sum(Vs[:2]) / 2
        Vs.pop(0)
        Vs.pop(0)
        Vs.append(two)

    print(two)


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(ans)

Solution (Python):
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: str(sys.stdin.buffer.readline().rstrip())
rs = lambda: map(str, sys.stdin.buffer.readline().split())
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

n = ri()
a = rl()
def heapsort(l):
  li = []
  for v in l:
    heapq.heappush(li, v)
  return [heapq.heappop(li) for _ in range(len(li))]
a = heapsort(a)
ans = a[0]
for i in a:
  ans = (ans + i)/2
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):
from functools import reduce

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

V = sorted(V)
ans = reduce(lambda x,y: (x+y)/2, V, V[0])

print(ans)

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

for i in range(1, n):
  x=float(sum(v[-2:])/2)
  
  del v[-2:]
  v.append(x)

print(sum(v))

Solution (Python):
n=int(input())
v= list(map(int,input().split()))
c=[0]*(n)
v.sort()

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

Solution (Python):
N = int(input()) 
V = list(map(int, input().split()))
V = sorted(V)
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=sorted(list(map(int,input().split())))
while len(v)>1:
    v[0]=(v[0]+v[1])/2
    v.pop(1)
print(*v)

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

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

Solution (Python):
n = int(input())
nums = list(map(float, 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)
vm = v[0]
for i in range(1, N):
    vm = (vm + v[i])*0.5
print(vm)

Solution (Python):
import heapq

n = int(input())
v = list(map(int, 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()))

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

print(V[N-1])

Solution (Python):
def resolve():
    N = int(input())
    v = list(map(int, input().split()))
    if len(v) == 1:
        print(v[0])
        return

    v.sort()
    while len(v) >= 2:
        new = (v[0] + v[1]) / 2
        v.pop(0)
        v.pop(0)
        v.append(new)
        v.sort()

    print(v[0])

resolve()

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

Solution (Python):
import heapq
N = int(input())
A = [ i for i in list(map(int,input().split()))]
heapq.heapify(A)

for i in range(N-1):
  a = heapq.heappop(A)
  b = heapq.heappop(A)
  heapq.heappush(A, ((a+b)/2))

print(heapq.heappop(A))

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

ans = vs[0]
for i in range(1, N):
    ans = (ans + vs[i]) * 0.5
print(ans)

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

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

Solution (Python):
N = int(input())
v = list(map(int, input().split(' ')))
v.sort()
item1 = v.pop(0)
while v:
  item2 = v.pop(0)
  v.append((item1 + item2) / 2)
  v.sort()
  item1 = v.pop(0)
print(item1)

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

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

v.sort()
while True:
    if len(v) == 1:
        break
    v[0] = f(v[0],v[1])
    del v[1]
print(v[0])

Solution (Python):
import sys
from collections import deque
import bisect
input = lambda: sys.stdin.readline().rstrip()


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

    while len(v) > 1:
        v1 = v.pop(0)
        v2 = v.pop(0)
        nv = (v1 + v2) / 2
        if len(v) == 0:
            break
        else:
            i = bisect.bisect_left(v, nv)
            v.insert(i, nv)

    print(nv)


if __name__ == '__main__':
    solve()

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):
def f(x, y):
  return (x + y) / 2

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=False)

while True:
  if len(A) == 1:
    break
  A[0] = f(A[0], A[1])
  del A[1]

print(A[0])

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):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

n, *v = map(int, read().split())

v.sort()

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

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

while(len(li)>1):
  li.sort()
  li.append((li[0]+li[1])/2)
  del li[0:2]
  
print(li[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):
from functools import reduce
def main():
    n = int(input())
    a = reduce(lambda x, y: (x+y)/2, sorted(map(int, input().split())))
    print(a)
    
if __name__ == "__main__":
    main()

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

while len(V) > 1:
    first = V.pop()
    second = V.pop()
    mixed = (first+second)/2
    V.append(mixed)

print(V[0])

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

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

lis = sorted(lis)

if len(lis) == 2:
    print((lis[0]+lis[1])/2)
    exit()
else:
    ans = 0
    tmp = (lis[0]+lis[1])/2
    for i in range(2,n-1):
        tmp = (tmp + lis[i])/2
        
    ans = (tmp+lis[n-1])/2
    
print(ans)

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

Solution (Python):
N = int(input())
v = list(input().split())
v = list(sorted([int(v[i]) for i in range(N)]))
MAX = v[0]

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

print(MAX)

Solution (Python):
import heapq
n,heap = raw_input(), map(float, raw_input().split(' '))
heapq.heapify(heap)
while(len(heap)>1): heapq.heappush(heap,  (heapq.heappop(heap) + heapq.heappop(heap)) * 0.5)
print heap[0]

Solution (Python):
import heapq
n = raw_input()
heap = [x*(1) for x in map(float, raw_input().split(' '))]
heapq.heapify(heap)

while(len(heap)>1):
	u,v = heapq.heappop(heap), heapq.heappop(heap)
	w = 0.5*(u+v)
	heapq.heappush(heap, w)

print heap[0]

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

ans = V[0]
for e in V:
    ans = (ans + e) / 2
print(ans)

Solution (Python):

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

v.sort()

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


print(v[N-1])

Solution (Python):

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


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

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

v_sorted = sorted(v)

ans = [0]*N

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

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

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

while True:
    if len(v_list_s) <= 1:
        break
    temp_c = (v_list_s[-1] + v_list_s[-2])/2
    v_list_s.remove(v_list_s[-1])
    v_list_s.remove(v_list_s[-1])
    v_list_s.append(temp_c)

print(sorted(v_list_s)[0])

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

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

Solution (Python):
import sys
from io import StringIO
import unittest


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

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)

    def test_入力例_1(self):
        input = """2
3 4"""
        output = """3.5"""
        self.assertIO(input, output)

    def test_入力例_2(self):
        input = """3
500 300 200"""
        output = """375"""
        self.assertIO(input, output)

    def test_入力例_3(self):
        input = """5
138 138 138 138 138"""
        output = """138"""
        self.assertIO(input, output)


if __name__ == "__main__":
    
    resolve()

Solution (Python):
import numpy as np
def resolve():
    N = int(input())
    V = np.array(list(map(int,input().split())))
    Vs = np.sort(V)
    ans = Vs[0] / 2**(N-1)
    for i in range(1,N):
        ans = ans + Vs[i] / 2**(N-i)
    print(ans)
resolve()

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

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

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

print(v[0])

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

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

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

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

mean = v[0]

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

print(mean)

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

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


def main():
    input = stdin.buffer.readline
    n = int(input())
    v = list(map(int, input().split()))
    heapify(v)

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

    print(v[0])


if __name__ == "__main__":
    setrecursionlimit(10000)
    main()

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

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

print(ans)

Solution (Python):

import sys
import heapq


def solve(N: int, v: "List[int]"):
    heapq.heapify(v)
    while v:
        mix = (heapq.heappop(v) + heapq.heappop(v)) / 2
        heapq.heappush(v, mix)

        if len(v) == 1:
            break
    print(*v)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word

    tokens = iterate_tokens()
    N = int(next(tokens))  
    v = [int(next(tokens)) for _ in range(N)]  
    solve(N, v)


if __name__ == "__main__":
    main()

Solution (Python):
import sys
sys.setrecursionlimit(10**6)

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

V.sort()
ans = 0

for i,v in enumerate(V):
    if i == 0:
        ans += v/(2**(n-i-1))
    else:
        ans += v/(2**(n-i))

print(ans)

Solution (Python):






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





mylist = sorted(v)
while True:
    tmp = (mylist[0] + mylist[1]) / 2
    del mylist[:2]
    mylist.insert(0, tmp)
    if len(mylist) == 1:
        print(mylist[0])
        break

Solution (Python):

N =int(input())
V = sorted([int(i) for i in input().split()])
ans = 0

for i,v in enumerate(V):
    if i<2:
        ans +=v/(2**(N-1))
    else:
        ans += v/(2**(N-i))
print(ans)

Solution (Python):


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


v.sort()
ans = v[0]

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

Solution (Python):

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

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

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

for i in range(N-1):
    v.sort()
    v1 = v.pop(0)
    v2 = v.pop(0)

    v.append((v1 + v2) / 2)
print(v[0])

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

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

while len(V) > 1:
    x = V.pop(V.index(min(V)))
    y = V.pop(V.index(min(V)))
    V.append((x + y) / 2)

print(V[0])

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

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

Solution (Python):

import sys
input = sys.stdin.readline









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

ans = 0
import heapq
heapq.heapify(l)
while(len(l)>1):
    a = heapq.heappop(l)
    b = heapq.heappop(l)
    c = (a+b)/2
    heapq.heappush(l,c)

print(l[0])

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

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

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

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

print(value)

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

V.sort()


ans = 0

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

print(ans)

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

Solution (Python):
def main():
    n = int(input())
    v = list(map(int, input().split()))
    
    if len(v) == 1:
        return
    
    v = sorted(v, reverse=True)
    ans = (v.pop() + v.pop()) / 2
    
    while v != []:
        v = sorted(v, reverse=True)
        ans = (ans + v.pop()) / 2
        
    print(ans)
    
if __name__ == '__main__':
    main()

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

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

Solution (Python):

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



if __name__ == '__main__':
    main()

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

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

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

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

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

Solution (Python):

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    _ = int(readline())
    vs = sorted(list(map(int, readline().split())), reverse=True)
    vs[-1] *= 2

    ans = 0
    r = 2
    for v in vs:
        ans += v / r
        r *= 2
    print(ans)


if __name__ == '__main__':
    main()

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

Solution (Python):
def medians(lst):
    if len(lst) == 1:
        return lst[0]
      
    last = lst.pop()
    second = lst.pop()
    lst.append((last + second) / 2)
    return medians(lst)


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

v.sort(reverse=True)
print(medians(v))

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

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

Solution (Python):
from functools import reduce


def li():
    return list(map(int, input().split()))


def mi():
    return map(int, input().split())


def ii():
    return int(input())


N = ii()
v = li()

v.sort()


res = reduce(lambda v1, v2: (v1 + v2) / 2, v)

print(res)

Solution (Python):
import sys
def I(): return int(sys.stdin.readline().rstrip())
def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))
def S(): return sys.stdin.readline().rstrip()

N = I()
v = LI()

v = sorted(v,reverse=True)

ans = 0

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

print(ans + v[N-1]/(2**(N-1)))

Solution (Python):
import sys
from collections import deque


def I(): return int(sys.stdin.readline().rstrip())


def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))


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


def LS(): return list(sys.stdin.readline().rstrip().split())


N = I()
v = LI()
v = sorted(v)
d = deque(v)



while len(d) != 1:
    one = d.popleft()
    two = d.popleft()
    ave = (one+two)/2
    d.appendleft(ave)

print(d.pop())

Solution (Python):
def main():
    input()
    t = list(map(int, input().split()))
    t.sort(reverse=True)
    while len(t) > 1:
        tmp = t.pop(-1)
        tmp2 = t.pop(-1)
        t.append((tmp+tmp2)/2)
    print(t[0])

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

Solution (Python):
from collections import deque
N = int(input())
N -= 1
D = deque(sorted(list(map(int, input().split()))))
ans = D.popleft() / (2 ** N)
while D:
  d = D.popleft()
  ans += d / (2 ** N)
  N -= 1
print(ans)