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



Sample input:
2
3 4


Sample output:
3.5

Submission status: Accepted

Solution code:
n = int(input())
li = list(map(int,input().split()))
sorted_li = sorted(li)
new_li = []
for i in range(n):
    if i == 0:
        new_li.append(sorted_li[0]/(2**(n-1)))
    else:
        new_li.append(sorted_li[i]/(2**(n-i)))
print(sum(new_li))

Submission status: Accepted

Solution code:
N = int(input())
U = list(map(int,input().split()))
U = sorted(U)
ans = U[0]/(2**(N-1))
for i in range(1,N):
    ans += U[i]/(2**(N-i))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
vl =list(map(int,input().split()))
ans = 0

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

print(ans)

Submission status: Accepted

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

print(sum)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

V_asc = sorted(V)

mix_v = V_asc[0]
for v in V_asc[1:]:
    mix_v = (mix_v + v) / 2

print(mix_v)

Submission status: Accepted

Solution code:
# -*- condig:utf-8 -*-

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

v.sort()
current = v[0]
for i in range(1, len(v)):
  current = (current+v[i])/2
print(current)

Submission status: Accepted

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

val = 0
v_1 = sorted(v)
for i in range(N-1):
  news = (v_1[0]+v_1[1])/2
  v_1.append(news)
  del v_1[0:2]
  v_1.sort()

print(v_1[0])

Submission status: Accepted

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

v.sort()
tmp = []
tmp.append(v[0])
for i in range(n):
    tmp.append((tmp[i] + v[i]) / 2)

print(tmp.pop())

Submission status: Accepted

Solution code:
import numpy
n = int(input())

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

v.sort()

sum = (v[0] + v[1])/2;

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

print(str(sum))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
A = [float(x) for x in input().split()]
#A = [500,300,200]
A = sorted(A)
buf = A[0]
for a in A[1:]:
    buf = (buf+a)/2
print(buf)

Submission status: Accepted

Solution code:
n=int(input())
a=list(map(int,input().split()))
s=0
while len(a)>1:
 for i in range(2):
  s+=min(a)
  a.remove(min(a))
 a.append(s/2)
 s=0
print(a[0])

Submission status: Accepted

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

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

print(v[n-1])

Submission status: Accepted

Solution code:
a = int(input())
nums = sorted(map(int, input().split()))


fact = nums[0]
for i in range(len(nums)):
    fact = (fact + nums[i]) / 2


print(fact)

Submission status: Accepted

Solution code:
#coding: utf-8
n = int(input())
materials = list(map(int,input().split()))
materials.sort()
value = materials[0]

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

print(value)

Submission status: Accepted

Solution code:
n=int(input())
v=[int(i) for i in input().split()]
v.sort()
ans=0
for i in range(n):
  
  if i<n-1:
    ans+=v[n-i-1]/(2**(i+1))
  else:
    ans+=v[n-i-1]/(2**(n-1))
print(ans)

Submission status: Accepted

Solution code:
N = int(input())
v = map(int,input().split())
v = sorted(v,reverse=True)
l = [v[i]*1/2**(i+1) for i in range(N-1)]
l.append(v[-1]/2**(N-1))
print(sum(l))

Submission status: Accepted

Solution code:
n = int(input())
vs = list(map(int,input().split()))
vs.sort()
ans = vs.pop(0)
for i in range(n-1):
    ne = vs.pop(0)
    ans = (ans + ne) /2
print(ans)

Submission status: Accepted

Solution code:
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])

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
v.sort(reverse=True)
while len(v)>=2:
	v.append(round((v.pop()+v.pop())/2,7))
print(v.pop())

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
v.sort()
pot = v[0]

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

print(pot)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# max を求めたい
# 小さいものを先に足して行くことを繰り返す
n = int(input())
a = list(map(int,input().split()))
a.sort()
ans = a[0]/(2**n) # a[0]/(2**(n-1))が実際に足したい値なので、差分を先に足しておく
for i in range(n):
  ans += a[i]/(2**(n-i))
print(ans)

Submission status: Accepted

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

new = 0
while len(vlist) > 1:
  new = (vlist.pop(0) + vlist.pop(0))/2
  vlist.insert(0,new)

print(vlist.pop())

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
ans = 0
for i in range(len(v)-1):
	v[i+1] = (v[i] + v[i+1])/2
print(str(v[len(v)-1]))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
lst = list(map(lambda x:int(x), input().split()))

lst.sort()

heikin = lst[0]
for i in range(n):
    if i == 0:
        pass
    else:
        heikin = (heikin+lst[i])/2.0

print(heikin)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline

def f(v):
        v0 = v.pop(0)
        v1 = v.pop(0)
        v.append((v0+v1)/2)
        v.sort()
        # print(v)
        if len(v) == 1:
                print(v[0])
                exit()
        else:
                f(v)

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
import numpy as np

def set_list(es):
    return len(list(set(es))) == 1

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

if(len(a)==2):
    print((a[0]+a[1])/2)    
elif(len(a)!=2 and set_list(a)):
    print(a[0])
else:
    for i in range(1,n):
        idx = np.argmin(a)
        num1 = a.pop(idx)
        idx = np.argmin(a)
        num2 = a.pop(idx)
        a.append((num1+num2)/2)
    print(a[0])

Submission status: Accepted

Solution code:
N = int(input())
l = sorted(list(map(float, input().split())))

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

print(l[N-1])

Submission status: Accepted

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

v_list.sort(reverse=True)
v_list[-2] += v_list[-1]
v_list.pop(-1)

cnt = 1
ans = 0
for v in v_list:
    ans += v/(2**cnt)
    cnt += 1
    
print(ans)

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(Vs)

for _ in range(N-1):
    tmp = (heapq.heappop(Vs) + heapq.heappop(Vs))/2
    heapq.heappush(Vs, tmp)
    
print(heapq.heappop(Vs))

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    vs = [int(x) for x in input().split()]
    while len(vs) > 1:
        vs = sorted(vs)
        x , y = vs[0], vs[1]
        vs[1] = (x + y) / 2
        vs.pop(0)
    print(vs[0])
    return


if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
n = int(input())
v = input().split()

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

v = sorted(v)

ans = v[0]

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

print(ans)

Submission status: Accepted

Solution code:
import heapq

N = int(input())
Vn = list(map(int,input().split(' ')))
heapq.heapify(Vn)
init_val = heapq.heappop(Vn) 

for _ in range(N -1):
    init_val = (init_val + heapq.heappop(Vn))/2
print(init_val)

Submission status: Accepted

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

V.sort()

if N==2:
    ans = (V[0]+V[1])/2
    print(ans)

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-

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

vn.sort()

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

Submission status: Accepted

Solution code:
import sys
from collections import deque
import heapq
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

N = I()
a = IL()
a.sort(reverse=True)

tmp = 0
for i in range(N-1):
  tmp = (a.pop()+a.pop())/2
  a.append(tmp)
  a.sort(reverse=True)

print(a[-1])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
V = list(map(int,input().split()))
V.sort()
i = 1
A = V[0]
naga = len(V)
while i < naga:
    A=(A+V[i])/2
    i += 1
print(A)

Submission status: Accepted

Solution code:
N = int(input())
A = list(map(int, input().split()))
A.sort()
mid = (A[0]+A[1])/2
if(N>=3):
    for i in range(2, N):
        mid = (mid+A[i])/2
    print(mid)
else:
    print(mid)

Submission status: Accepted

Solution code:
from bisect import insort_left

n = int(input())
values = list(map(int, input().split()))
values = sorted(values)

for _ in range(n - 1):
    if len(values) < 2:
        break
    x = values.pop(0)
    y = values.pop(0)
    new_value = (x + y) / 2.0
    insort_left(values, new_value)

print(values[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

while len(vlist) != 1:
    min1 = min(vlist)
    vlist.remove(min1)
    min2 = min(vlist)
    vlist.remove(min2)
    app = (min1+min2)/2
    vlist.append(app)

print(vlist[0])

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
v_seq=list(map(int,input().split()))
v_seq.sort()
while len(v_seq)>=2:
    cmp=(v_seq[0]+v_seq[1])/2
    v_seq[0]=cmp
    del v_seq[1]
    v_seq.sort()
print(v_seq[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np
import sys

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

    a.sort()
    ret = (a[0] + a[1])/2

    for i in range(2, len(a)):
        ret = (ret+a[i])/2
    

    
    print(ret)
        


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
v_list = sorted([int(x) for x in input().split()])
ans = v_list[0]
for v in v_list[1:]:
    ans = (ans + v)/2
print(ans)

Submission status: Accepted

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

V.sort()
#print(V)

while not len(V) == 1:
    temp = (V[0] + V[1]) / 2
    del V[1]
    V[0] = temp

print(V[0])

Submission status: Accepted

Solution code:
a=int(input())
s=list(map(int,input().split()))

s.sort()

i=1
result=s[0]

while i<len(s):
  result=(result+s[i])/2
  
  i=i+1

print(result)

Submission status: Accepted

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

V.sort()
gousei = 0

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

print(gousei)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# 整数の入力
n = int(input())
# スペース区切りの整数の入力
v = list(map(int, input().split()))

# 価値の昇順にソート
v.sort(reverse=False)

# 価値の低いものから順に合成していく
result = (v[0] + v[1])/2

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

print(str(result))

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop, heapify
from functools import reduce
import sys
import math
import bisect
import random
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return list(map(float, sys.stdin.readline().split()))
def LS():return sys.stdin.readline().split()
def SR(n): return [list(sys.stdin.readline())[:-1] for i in range(n)]
def IR(n): return [int(sys.stdin.readline()) for i in range(n)]
def LIR(n): return [list(map(int, sys.stdin.readline().split())) for i in range(n)]
def LSR(n): return [list(map(list, sys.stdin.readline().split())) for i in range(n)]
_gcd = lambda x, y: _gcd(y, x%y) if (x%y) else y
_lcm = lambda x, y: x*y // _gcd(x, y)
def gcd(*numbers):
    return reduce(_gcd, numbers)
def lcm(*numbers):
    return reduce(_lcm, numbers)
sys.setrecursionlimit(1000000)
INF = float('inf')
mod = 1000000007
dire4 = [(1,0), (0,1), (-1,0), (0,-1)]
dire8 = [(1, 0), (1, 1), (0, 1), (-1, 1), (-1, 0), (-1, -1), (0, -1), (1, -1)]

N = I()
v = LI()

heapify(v)

for i in range(N-1) :
    a = heappop(v)
    b = heappop(v)
    heappush(v, (a + b) / 2)
    
print(*v)

Submission status: Accepted

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

v = sorted(v)

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import numpy as np

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

a = np.array(a)
a.sort()

s = a[0]
for x in a:
  s = (s + x)/2
print(s)

Submission status: Accepted

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

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

print(a[0])

Submission status: Accepted

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

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

print(V[0])

Submission status: Accepted

Solution code:
n = int(input().strip())

array = list(map(int, input().strip().split(' ')))
array.sort()

s = (array[0] + array[1] )/2
for i in range(n-2):
    m = (s + array[i+2])/2
    s = m
print(s)

Submission status: Accepted

Solution code:
n = int(input())
List = list(map(int, input().split()))

List.sort()

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

print(Answer)

Submission status: Accepted

Solution code:
n=int(input())
li = list(map(int,input().split()))
li.sort()
while True:
    if len(li) == 1:
        break;
    else:
        x=(li[0]+li[1])/2
        li.pop(0)
        li.pop(0)
        li.insert(0,x)
print(li[0])

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
v.sort()
v.append(0)
ave = (v[0] + v[1]) / 2
for x in v[2:]:
    if x == 0:
        break
    else:
        ave = (ave + x) / 2
print(ave)

Submission status: Accepted

Solution code:
i = int(input())
l = list(map(int,input().split()))

while len(l)!=1:
	l.sort()
	#print(l)
	x = (l[1] + l[0])/2
	if len(l)==2:
		print(x)
		exit()
	l.pop(1)
	l.pop(0)
	l.append(x)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().rstrip().split(' ')))
V.sort(reverse=True)

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

Submission status: Accepted

Solution code:
N = int(input())
v_list = list(map(lambda x:int(x),input().split(" ")))

while len(v_list) > 1:
  min_1 = min(v_list)
  v_list.remove(min_1)
  min_2 = min(v_list)
  v_list.remove(min_2)
  new_value = (min_1 + min_2)/2
  v_list.append(new_value)

print(v_list[0])

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()
for i in range(100):
    if len(v) <= 1:
        break
    a = (v[0] + v[1]) / 2
    v = [a] + v[2:]
    v.sort()

print(*v)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
vl = sorted( map(int, input().split()) )
ans = vl[0] / (2**(len(vl)-1))
for i in range(len(vl)-1):
    ans += (vl[i+1] / (2**(len(vl)-1-i)))

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

print(v[n-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#  --*-coding:utf-8-*--

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

    x = V[0]

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import numpy as np    
N = int(input())
vstr = input().split()
vs = [int(v) for v in vstr]

for i in range(N-1):
    valarg = np.argmin(vs)
    val1 = vs.pop(valarg)
    valarg = np.argmin(vs)
    val2 = vs.pop(valarg)
    vs.append((val1+val2)/2)
    if len(vs) == 1:
        break
print(vs[0])

Submission status: Accepted

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

V = sorted(V)

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

print(V[-1])

Submission status: Accepted

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

A.sort()
stock = 0
count = 0

for i in A:
    if count == 0:
        stock = i
        count += 1
    else:
        stock = (stock + i)/2
    
print(stock)

Submission status: Accepted

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

v.sort(reverse=True)

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10000000)
def input():
    return sys.stdin.readline()[:-1]
from bisect import *
from collections import *
from heapq import *
from math import *
from itertools import *

N = int(input())
q = list(map(int, input().split()))
heapify(q)
while len(q) > 1:
    a, b = heappop(q), heappop(q)
    heappush(q, (a+b)*0.5)
print(q[0])

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    vs = list(map(lambda x: int(x), input().split(' ')))
    vs.sort()
    ans = vs[0] / (2 ** (n - 1))
    for i in range(1, n):
        ans += (vs[i] / (2 ** (n - i)))
    print(ans)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

V = sorted(V)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())						# 5
V = sorted(list( map(int, input().split()) ))	# 1 2 3 4 5 ...(ソート付き)


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

print(V[N-1])

Submission status: Accepted

Solution code:

N  = int(input())
v = [int(i) for i in input().split()]
s = 0

for i in range(N-1):
  a = min(v)
  v.remove(a)
  b = min(v)
  v.remove(b)
  s = (a + b)/2
  v.append(s)
  

print(s)

Submission status: Accepted

Solution code:
from heapq import heapify,heapreplace,heappop
N=int(input())
A=list(map(int,input().split()))
A=[a for a in A]
heapify(A)
while len(A)>1:
    t = heappop(A)
    heapreplace(A,(t+A[0])/2)
print(A[0])

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split(' ')]

a.sort()
s = a[0]

for c in range(1, n) :
    s = (s + a[c]) /2

print(s)

Submission status: Accepted

Solution code:
N = int(input())
goods = list(map(int, input().split()))
if N == 2:
    print(sum(goods)/2)
else:
    while len(goods) > 2:
        goods = sorted(goods)
        a = goods.pop(0)
        b = goods.pop(0)
        goods.append((a+b)/2)
    print(sum(goods)/2)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
v_list = list(map(int, input().split()))
v_list = sorted(v_list)
sum = 0

for v,i in zip(v_list, range(1, N+1)):
  if i < 3:
    sum += v
  else:
    sum += (2**(i - 2)) * v
print(sum/(2**(i-1)))

Submission status: Accepted

Solution code:
input()
v = sorted(map(int, input().split()))
r = v[0]
for x in v:
    r = (r + x) / 2
print(r)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(v) for v in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
sum=0
S=list(map(int,input().split()))
S.sort()
for i in range(N-1):
    if i==0:
        
        sum=(S[i]+S[i+1])/2
    
    else:
        sum=(sum+S[i+1])/2

print(sum)

Submission status: Accepted

Solution code:
N = int(input())

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

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

Submission status: Accepted

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

sv = sorted(v)
z = sv[0]
for s in sv[1:]:
    z = (z + s) / 2

print(z)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
ls=list(map(int,input().split()))
ls.sort()
init=ls.pop(0)
ans=0
for i in ls:
    ans=(init+i)/2
    init=ans
print(ans)

Submission status: Accepted

Solution code:
import numpy as np

N = int(input())
v = np.fromstring(input(), sep=' ')
v.sort()
ans = (v[0] + v[1]) / 2
for i in range(2, N):
    ans = (ans + v[i]) / 2
print(ans)

Submission status: Accepted

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

print(value)

Submission status: Accepted

Solution code:
N = int(input())
#N,A,B = map(int,input().split())
V_list = list(map(int,input().split()))
#X1_list = [int(input()) for i in range(N)]
#X2_list = [list(map(int,input().split())) for i in range(N)]
V_list = sorted(V_list)
result = (V_list[0] + V_list[1]) /2
for i in range(2,N):
    tmp = (result + V_list[i] )/2
    result = ((result + V_list[i]) /2)
print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

print(an)

Submission status: Accepted

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

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

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

print(new)

Submission status: Accepted

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

H.sort(reverse=True)

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

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

print(sum(H))

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
from decimal import Decimal
v = list(map(int,input().split()))
v = list(map(Decimal,v))

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

Submission status: Accepted

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

v.sort()

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

ans = v[N-1]

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import bisect

N = int(input())

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

v_list = sorted(v_list)

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

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

print(v_list[0])