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 sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians

from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from functools import reduce
from bisect import bisect_left, insort_left
from heapq import heapify, heappush, heappop

INPUT = lambda: sys.stdin.readline().rstrip()
INT = lambda: int(INPUT())
MAP = lambda: map(int, INPUT().split())
S_MAP = lambda: map(str, INPUT().split())
LIST = lambda: list(map(int, INPUT().split()))
S_LIST = lambda: list(map(str, INPUT().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7


def ave(L):
    if len(L) == 1: return L[0]
    elif len(L) == 2: return (L[0] + L[1]) / 2
    else: return (L[0] + ave(L[1:len(L)])) / 2
    


def main():
    N = INT()
    V = LIST()
    
    V = sorted(V, reverse=True)
    print(ave(V))


if __name__ == '__main__':
        main()

Solution (Python):
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
V = LIST()

V = list(sorted(V))
V = [float(v) for v in V]


def sum_func(V):
    return (V[0] + V[1]) / 2


while True:
    if len(V) == 1:
        print(V[0])
        break
    else:
        V = [sum_func(V)] + V[2:]

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

v = sorted(v)

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

print(x)

Solution (Python):

import heapq 
n = int(input())
v = list(map(int, input().split()))
heapq.heapify(v)   
ans = 0
for i in range(n-1):
    tmp1 = heapq.heappop(v)               
    tmp2 = heapq.heappop(v)               
    tmp = (tmp1 + tmp2) / 2
    heapq.heappush(v, tmp)
ans = heapq.heappop(v)               
print(ans)

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

V.sort()

while(len(V) > 1):
    v1 = V.pop(0)
    v2 = V.pop(0)
    V.insert(0, (v1+v2)/2)
print(V[0])

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

while len(v)>=2:
    x=min(v)
    v.remove(min(v))
    y=min(v)
    v.remove(min(v))
    v.append((x+y)/2)
print(sum(v))

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

a=a[0]
p = 0
a=a-1

b.sort()
for i in range(a):
	p=(b[i]+b[i+1])/2
	b[i+1]=p

print(b[a])

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):
def main():
    n=int(input()) 
    V=sorted(map(int,input().split()))
    ans = 0
    for i,v in enumerate(V):
        ans += v/2**min(n-1,n-i)
    print(ans)
main()

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

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

print(ans)

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

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

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

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

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

print(value)

Solution (Python):



def ri():
    return int(input())

def rl():
    return list(input().split())

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

def main():
    n = ri()
    lv = rli()
    lv.sort()
    ans = lv[0]
    for i in range(1, n):
        ans = (ans+lv[i])/2
    print(ans)


if __name__ == '__main__':
    main()

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

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

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

print(V[0])

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

a=[] 

for i in range(n): 
	if i==0: 
		
		a.append(lst[i]) 
	else: 
		
		a.append((a[-1]+lst[i])/2)   
print(a[-1])

Solution (Python):
from sys import stdin

n = int(stdin.readline().rstrip())
a = [int(x) for x in stdin.readline().rstrip().split()]

for i in range(n - 1):
    pot = []
    pot.append(min(a))
    a.pop(a.index(min(a)))
    pot.append(min(a))
    a.pop(a.index(min(a)))
    a.append(sum(pot)/2)

print(*a)

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

Solution (Python):
import sys
input = sys.stdin.readline
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())
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())
v = [int(x) for x in input().split()]

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

print(x)

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

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

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

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

while True:
    if len(v)==1:
        break
    tmp = (v[0]+v[1])/2
    v.append(tmp)
    v.remove(v[0])
    v.remove(v[0])
    v.sort()
print(*v)

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

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

print(ans)

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

while len(value) > 1:
    value.append((value.pop()+value.pop()) / 2)

print(value[0])

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

v.sort()
while True:
    if len(v) > 1:
        new = (v.pop(0)+v.pop(0))/2
        v.append(new)
        v.sort()
    else:
        break

print(v[0])

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
v = LIST()
v.sort()
ans = v[0]

for x in v:
	ans = (ans+x)/2
print(ans)

Solution (Python):




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

    while len(V) != 1:
        V.sort()
        v1, v2 = V.pop(0), V.pop(0)
        V.append((v1 + v2) / 2)

    print(*V)


if __name__ == "__main__":
    main()

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

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

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

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

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

v_ls.sort()
first = v_ls[0]
ind = 1
while ind < n:
    first = (first + v_ls[ind]) / 2
    ind += 1
print(first)

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

V.sort()

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

Solution (Python):
import sys
import math
import bisect
import numpy as np
input = sys.stdin.readline
MOD = 10**9 + 7
INF = float('INF')

def main():
    n = int(input())
    v = list(map(float,input().split()))
    v = np.array(v)
    v.sort()

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

    ans = sum(v)
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
N=int(input())
v=list(map(int, input().split()))
v.sort()
i=0
while True:
    if len(v)<2:
        break
    buf=(v[0]+v[1])/2
    v=v[2:]
    v.insert(0,buf)
print(v[0])

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

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

print(w[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
n = int(input())
v = map(int, input().split())

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

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

V_s = sorted(V)
res = V_s[0]
for i in range(N-1):
    res = (res+V_s[i+1])/2.0
print(res)

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

l.sort()
result=l[0]

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

print(result)

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

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

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

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

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

print(v[-1])

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):
from collections import deque

N = int(input())
s = list(map(int, input().split()))
s.sort()
s = deque(s)
gosei = 0
i = 0
while len(s) > 1:
    x = s.popleft()
    y = s.popleft()
    gosei = (x + y) / 2
    s.appendleft(gosei)
print(gosei)

Solution (Python):



def main():
  n = int(input())
  Vs = list(map(int, input().strip().split()))
  Vs.sort()
  sum = Vs[0]
  for V in Vs[1:]:
    sum += V
    sum /= 2
  print(sum)

if __name__=='__main__':
  main()

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

Solution (Python):



from math import *
from copy import *
from string import *				
from random import *				
from sys import stdin
from sys import maxsize
from operator import *				
from itertools import *
from collections import Counter		
from collections import defaultdict 

'''

'''

def solve(l):
	k = 0
	n = len(l)
	l = sorted(l)
	while(k < n-1):
		ans = l[0] + l[1]
		zz = ans/2
		l.pop(0)
		l.pop(0)
		l.insert(0,zz)
		k += 1
	return round(l[0],10)

N = int(stdin.readline())
l = list(map(int, stdin.readline().rstrip().split()))
ans = solve(l)
print("%10f"%ans)

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

Solution (Python):

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

if __name__ == '__main__':
    main()

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

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

print(ans)

Solution (Python):
import sys
import itertools



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

N, *H = map(int, read().split())
H.sort(reverse=True)
while len(H) > 1:
    x = H.pop()
    y = H.pop()
    H.append((x+y)/2)
print(H[0])

Solution (Python):
import sys
import itertools



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

N, *H = map(int, read().split())
cnt = 1
H.sort()
ans = H[0]
for i in H[1:]:
    ans += cnt * i
    cnt *= 2
print(ans / cnt)

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

v.sort()

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

print(s)

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

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

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

t.sort()

res = t[0]

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

Solution (Python):

from collections import deque
def f(x, y):
    return (x+y)/2

def main():
    n = int(input())
    v = [int(i) for i in input().split()]
    while len(v) > 1:
        v.sort()
        a = v.pop(0)
        b = v.pop(0)
        v.append(f(a, b))
    print("{0:.12f}".format(v[0]))
main()

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

ans = v[:]

for i in range(n - 1):
    ans = sorted(ans)
    s = (ans[0] + ans[1]) / 2
    ans.pop(0)
    ans[0] = s

print(ans[0])

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

Solution (Python):
import heapq as q
N = input()
v = [int(x) for x in input().split()]
q.heapify(v)
while len(v) != 1:
    q.heappush(v, (q.heappop(v) + q.heappop(v)) / 2)
print(v[0])

Solution (Python):
import sys

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

def main():
    v.sort(reverse=True)
    res = 0
    for i in range(n-1):
        res += v[i] / 2 ** (i + 1)
    res += v[-1] / 2 ** (n - 1)
    return res

if __name__ == '__main__':
    ans = main()
    print(ans)

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

V.sort()

s=(V[0]+V[1])/2

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

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

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

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

sum = (l[0] + l[1])/2

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

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
while len(v)>1:
  v=sorted(v)
  v_1=v.pop(0)
  v_2=v.pop(0)
  v.append((v_1+v_2)/2)
print(v[0])

Solution (Python):
N=int(input())
v=list(map(int,input().split()))
while len(v)>1:
  v=sorted(v)
  v_1=v.pop(0)
  v_2=v.pop(0)
  v.append((v_1+v_2)/2)
print(v[0])

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

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

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

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

print(v[-1])

Solution (Python):
N=int(input())
gu=list(map(int,input().split()))
gu.sort()
ans=[]
cnt=2
k=(gu[0]+gu[1])/2
while cnt<=N-1:
        k=(k+gu[cnt])/2
        cnt+=1
    
print(k)

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

result = v[0]

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

print(result)

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_lst = list(map(int,input().split()))
v_lst.sort()
new_value = v_lst[0]

for i in range(1,n):
    value1 = v_lst[i]
    new_value += value1
    new_value /= 2

print(new_value)

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

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

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

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

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

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

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


V_asc = sorted(V)


sum_coef_v = 0
for i in range(N):
  coef = 2 ** (i-1)
  if i == 0: coef = 1
  sum_coef_v += coef * V_asc[i]

ans = sum_coef_v / (2 ** (N-1))
print(ans)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
v = LIST()

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

Solution (Python):
N = int(input())
M = list(map(int,input().split()))
X = sorted(M)
c = 0
for i, v in enumerate(X):
    if i >= N-1:
        break
    else:
        a = X[i]+X[i+1]
        b = a/2
        X[i+1]= a/2

print(b)

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, 1):
    if i == N:
        break
    ans = (ans + V[i]) / 2
print(ans)

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

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

while len(V) >= 2:
    V.sort(reverse=True)
    x = V.pop()
    y = V.pop()
    V.append((x+y)/2)
print(*V)

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

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

Solution (Python):
def main():
  n=int(input())
  w=sorted(map(int,input().split()))
  ans=(w[0]+w[1])/2
  for i in range(2,n):
    ans=ans/2+w[i]/2
  print(ans)
if __name__=="__main__":
  main()

Solution (Python):
def main():
  import sys
  from collections import deque
  n=int(input())
  v=list(map(int,sys.stdin.read().split()))
  w=deque(sorted(v))
  ans=(w.popleft()+w.popleft())/2
  for i in range(n-2):
    ans=ans/2
    ans+=w.popleft()/2
  print(ans)
if __name__=="__main__":
  main()

Solution (Python):
def main():
  import sys
  n=int(input())
  w=list(map(int,sys.stdin.read().split()))
  
  w.sort()
  ans=(w[0]+w[1])/2
  for i in range(2,n):
    ans=max(ans,ans/2+w[i]/2)
  print(ans)
  
if __name__=="__main__":
  main()

Solution (Python):
def main():
  import sys
  n=int(input())
  v=list(map(int,sys.stdin.read().split()))
  w=sorted(v,reverse=False)

  ans=(w[0]+w[1])/2
  for i in range(2,n):
    ans=max(ans,ans/2+w[i]/2)
  print(ans)
  
if __name__=="__main__":
  main()

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

  a=(w[0]+w[1])/2
  for i in range(2,n):
    a=max(a,a/2+w[i]/2)
  print(a)
  
if __name__=="__main__":
  main()

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

  ans=(w[0]+w[1])/2
  for i in range(2,n):
    ans=max(ans,ans/2+w[i]/2)
  print(ans)
  
if __name__=="__main__":
  main()

Solution (Python):
def main():
  import sys
  n=int(input())
  v=list(map(int,input().split()))
  w=sorted(v,reverse=False)

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

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

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

print(a[-1])

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

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

Solution (Python):
from heapq import heappush, heappop

N = int(input())
q = []

for i in map(int, input().split()):
    heappush(q, i)

for _ in range(N-1):
    a = heappop(q)
    b = heappop(q)
    c = (a+b)/2
    heappush(q, c)

ans = heappop(q)
print(ans)

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

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

v.sort()

s=0
for i in range(0,N):
    if i==0:
        s=s+v[0]
    else:
        s=s+v[i]*(2**(i-1))
print('{:.5g}'.format(s/(2**(N-1))))

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

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

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

print(ans)

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

l.sort()
ans = (l[0]+l[1])/2

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

print(ans)

Solution (Python):
n=int(input())
v=sorted(list(map(int,input().split())),reverse=True)
ans=v.pop()
while len(v)>=1:
    ans=(ans+v.pop())/2
print(ans)

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

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

Solution (Python):
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def main():
    n = int(input())
    Vs = list(map(int, input().split()))
    Vs.sort()
    
    while len(Vs) > 1:

        Vs[0] = (Vs[0] + Vs[1]) / 2
        Vs[1:] = Vs[2:]
    print(Vs[0])

    return

if __name__ == '__main__':
    main()

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

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


v.sort()


while len(v)>1:

    
    
    a1 =v.pop(0)
    a2 =v.pop(0)
    
    a3 = (a1 + a2) /2
    v.append(a3)
    v.sort()

print(v[0])

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

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

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

print(s)

Solution (Python):




def solve(inp):
    N = int(inp.readline().strip())
    V = list(map(int, inp.readline().strip().split(' ')))
    V = sorted(V)
    r = V[0]
    for v in V:
        r = (r + v) / 2
    return str(r)


def main():
    import sys
    result = solve(sys.stdin)
    if result is not None and result != '':
        print(result)


if __name__ == '__main__':
    main()

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

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

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

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

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

for v in v_list:
    ans=(ans+v)/2
    
print(ans)

Solution (Python):
from functools import reduce

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

ave = 0
temp = 0

ave = reduce(lambda a,b:(a+b)/2, v_list)

print(ave)

Solution (Python):
from functools import reduce
input()
print(reduce(lambda a,b:(a+b)/2,sorted(map(int,input().split()))))

Solution (Python):
from functools import reduce
_ = input()
print(reduce(lambda a, b: (a+b)/2, sorted(map(int, input().split()))))

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

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

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

Solution (Python):


import sys
import math
import time
import numpy as np
import collections
from collections import deque
import queue
import copy


def gcd(m,n):
  x = max(m,n)
  y = min(m,n)
  if x%y == 0:
    return y
  else:
    while x%y != 0:
      z = x%y
      x = y
      y = z
    else:
      return z


def bfs(SS, x, y, H, W):
  x_next = [0, 0, -1, 1]
  y_next = [1, -1, 0, 0]
  tempx = x
  tempy = y
  mlength = 0
  q = deque()
  xytuple = (x, y, 0)
  q.append(xytuple)


  while q:
    xytuple = q.popleft()
    SS[xytuple[0]][xytuple[1]] = "x" 
    for i in range(4): 
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      
      
      if(0 <= tempx and tempx < H and 0 <= tempy and tempy < W and SS[tempx][tempy] == "."):
        temptuple = (tempx, tempy, xytuple[2]+1)
        SS[temptuple[0]][temptuple[1]] = "x" 
        mlength = max(mlength, xytuple[2] +1)
        q.append(temptuple)
      
  return mlength





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

v.sort()

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

print(v[N-1])

Solution (Python):
n = int(input().rstrip())
s = map(int, input().rstrip().split(" "))

s = sorted(s)

sum = []
l = len(s)

sum = (s[0] + s[1]) / 2

for s in s[2:]:
    sum = (sum + s) / 2

print(sum)