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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

#print(n, v)
v.sort()
#print(v)

while len(v)>1:
#  for i in range(51): 
    #a1 = (v[i:i+1])
    #a2 = (v[i+1:i+2])
    a1 =v.pop(0)
    a2 =v.pop(0)
    #print(a1,a2)
    a3 = (a1 + a2) /2
    v.append(a3)
    v.sort()

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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


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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# coding:utf-8

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

# 幅優先探索(BFS)でスタート座標(x, y)からの最大距離返す
def bfs(SS, x, y, H, W):#入力(座標系(迷路), x, y, xの端, yの端)
  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): #このforで上下左右を調べてる
      tempx = xytuple[0] + x_next[i]
      tempy = xytuple[1] + y_next[i]
      #print(tempx, tempy, xytuple[2])
      #print(S)
      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)
      #print(q)
  return mlength


#X = str(input()).split()
#a = [int(x) for x in input().split()]

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

Submission status: Accepted

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

Submission status: Accepted

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

v=sorted(v)

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 heapq
n=int(input())
a=list(map(int,input().split()))
heapq.heapify(a)

while len(a)!=1:
  b=heapq.heappop(a)
  c=heapq.heappop(a)
  heapq.heappush(a,(b+c)/2)
print(sum(a))

Submission status: Accepted

Solution code:
def solve(n, V):
    V.sort()
    res = V.pop(0)
    for v in V:
        res = (res + v) / 2
    return res

_n = int(input())
_V = list(map(int, input().split()))
print(solve(_n, _V))

Submission status: Accepted

Solution code:
n = int(input())
vl = list(map(int, input().split()))
vl_s = sorted(vl)

n1 = vl_s[0]
for i in range(1, n):
    n2 = vl_s[i]
    ave = (n1 + n2) / 2
    n1 = ave

print(ave)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(n - 1):
    v_ = (v[0] + v[1]) / 2
    v.pop(0)
    v.pop(0)
    bisect.insort_left(v, v_)

print(v[0])

Submission status: Accepted

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

while len(V) > 1:
    if len(V) > 2:
        pick = V[0:2]
        V = [sum(pick)/2] + V[2:]
    else:
        V = [sum(V)/2]

print(V[0])

Submission status: Accepted

Solution code:
N = int(input())
lst = list(map(int,input().split(" ")))
lst.sort()
val = min(lst)
for i in range(1,len(lst)):
  val += (2**(i-1))*lst[i]
print(val/(2**(N-1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
B=sorted(A)
highest_value=0
M=1
while N-1>0:
  highest_value+=B[N-1]/(2**M)
  M+=1
  N-=1 
highest_value+=B[0]/(2**(M-1))
print(highest_value)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

sorted_v = sorted(v)

tmp = sorted_v[0]
for i in range(1, n):
    tmp = float((tmp + sorted_v[i]) / 2)

print(tmp)

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int, input().split()))
i = N
while i > 1:
  v.sort()
  tmp = (v.pop(0) + v.pop(0)) / 2
  v.append(tmp)
  i -= 1
print(v[0])

Submission status: Accepted

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

t = sorted(li)
ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache
import heapq

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

MOD = int(1e09) + 7

def main():
    N = cin.int()
    V = cin.mapInt()
    heapq.heapify(V)
    while len(V) >= 2:
        v = heapq.heappop(V) + heapq.heappop(V)
        v /= 2
        heapq.heappush(V,v)
    print(V[0])
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
import math
import os
import itertools
import _collections
import string
from functools import lru_cache

class cin():
    def int():
        return int(sys.stdin.readline().rstrip())
    def string():
        return sys.stdin.readline().rstrip()
    def mapInt():
        return [int(x) for x in cin.string().split()]
    def stringList(n):
        return [input() for i in range(n)]
    def intListList(n):
        return [cin.mapInt() for i in range(n)]
    def intColsList(n):
        return [int(input()) for i in range(n)]
        
class Math():
    def gcd(a,b):
        if b == 0:
            return a
        return Math.gcd(b,a % b)
    def lcm(a,b):
        return (a * b) // Math.gcd(a,b)
    def roundUp(a,b):
        return -(-a // b)
    def toUpperMultiple(a,x):
        return Math.roundUp(a,x) * x
    def toLowerMultiple(a,x):
        return (a // x) * x
    def nearPow2(n):
        if n <= 0:
            return 0
        if n & (n - 1) == 0:
            return n
        ret = 1
        while(n > 0):
            ret <<= 1
            n >>= 1
        return ret

MOD = int(1e09) + 7

def main():
    N = cin.int()
    V = cin.mapInt()
    while len(V) >= 2:
        V.sort()
        V.append((V.pop(0) + V.pop(0)) / 2)
    print(V[0])
    return

if __name__ == "__main__":
    main()

Submission status: Accepted

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

v.sort()

while len(v) > 1:
  a = v.pop(0)
  b = v.pop(0)
  c = [(a+b)/2]
  v = c + v
  
print(v[0])

Submission status: Accepted

Solution code:
n = int(input())
vn = [float(i) for i in input().split()]
vn.sort()
average = vn[0]
for i in range(1, n):
    average = (average + vn[i]) / 2
print(average)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    num_list = list(map(int, input().split()))

    num_list.sort()

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

    print(num_list[n-1])

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
# easy for C!!!

n = int(input())
l = [int(x) for x in input().split()]
i =0
while len(l) >= 2:
    l.sort()
    a = l.pop(i)
    b = l.pop(i)
    c = (a + b) / 2
    l.append (c)

print(*l)

Submission status: Accepted

Solution code:
# 

n = int(input())
l = [int(x) for x in input().split()]
i =0
while len(l) >= 2:
    l.sort()
    a = l.pop(i)
    b = l.pop(i)
    c = (a + b) / 2
    l.append (c)

print(*l)

Submission status: Accepted

Solution code:
from functools import reduce

N = int(input())
v = sorted(map(int, input().split()))
print(reduce(lambda x, y: (x + y) / 2, v))

Submission status: Accepted

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

v_s = sorted(v)

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

print(sum(v_s))

Submission status: Accepted

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

ans = l[0]

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

print(ans)

Submission status: Accepted

Solution code:
n,*a=map(int,open(0).read().split())
a.sort()
tmp=(a[0]+a[1])/2
for i in range(2,n):
  tmp=(tmp+a[i])/2
print(tmp)

Submission status: Accepted

Solution code:
def mix(x, y):
    return (x + y) / 2
    
N = int(input())
*V, = map(int, input().split())
V.sort()
ans = V[0]
for i in range(1, N):
    ans = mix(ans,V[i])
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

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

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

Submission status: Accepted

Solution code:
N = int(input())
Vs = list(map(int, input().split()))
Vs = sorted(Vs)
value = Vs[0]

for i in Vs[1:]:
    value += i
    value /= 2

print(value)

Submission status: Accepted

Solution code:
N = int(input())
Vs = list(map(int, input().split()))
value = 0
prop = 1

for i in range(N-2):
    MAX = max(Vs)
    prop = 0.5**(i+1)

    value += MAX * prop
    
    Vs.remove(MAX)

value += (Vs[0] + Vs[1]) * (prop/2)

print(value)

Submission status: Accepted

Solution code:
n = int(input())
L = []
value = 0
L = list(map(int, input().split()))

L2 = sorted(L)
value = (L2[0] + L2[1]) / 2
for j in range(2, n):
    value = (L2[j] + value) / 2

print(value)

Submission status: Accepted

Solution code:
n=int(input())
vi=[]
for i in map(int,input().split()):
    vi.append(i)
#print(hi)
vi.sort(reverse=True)

r=0.5
vsum=vi[0]*r

ri=0.5
for i in range(n-1):
    ri=ri*r
    vsum=vsum+vi[i+1]*ri
vsum=vsum+vi[i+1]*ri

print(vsum)

Submission status: Accepted

Solution code:
n = int(input())
V = list(map(int,input().split()))
for i in range(n-1):
    V.sort()
    for j in range(n-1):
        if V[j] == 0:
            continue
        else:
            Vx = (V[j]+V[j+1])/2
            V[j] = 0
            V[j+1] = Vx

print(V[n-1])

Submission status: Accepted

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

v.sort(reverse=True)

for i in range(n-1):
    val = (v.pop()+v.pop())/2
    v.append(val)

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(vs)

while len(vs) >= 2:
    t1 = heapq.heappop(vs)
    t2 = heapq.heappop(vs)
    value = (t1 + t2) / 2
    heapq.heappush(vs, value)

print(vs[0])

Submission status: Accepted

Solution code:
from functools import reduce
N = int(input())
values = sorted([int(i) for i in input().split()])

print(reduce(lambda a, b: (a + b)/2, values))

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
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)))

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n=int(input())
vlis=sorted(list(map(int,input().split())))
while len(vlis)>=2:
	a,b=vlis[0],vlis[1]
	vlis.pop(0)
	vlis.pop(0)
	vlis.insert(0,(a+b)/2)
print(vlis[0])

Submission status: Accepted

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

hoge = [1,1]
for i in range(1,N-1):
    hoge.append(2**i)

V.sort()
ans = 0
for i in range(len(hoge)):
    ans += hoge[i] * V[i]
print(ans/2**(N-1))

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

v = sorted(v)
avg = 0

#小さい順に計算していく
for i in range(len(v)):
  if i == 0:
    pass
  elif i == 1:
    avg = (v[0]+v[1])/2
  else:
    avg = (avg+v[i])/2
  
print(avg)

Submission status: Accepted

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

tmp = dv[0]
for d in dv[1:]:
    tmp = (tmp + d) / 2

print(tmp)

Submission status: Accepted

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

vs.sort(reverse = True)

for i in range(n - 1):
  pan = vs.pop()
  vs[-1] = (pan + vs[-1]) / 2

print(vs[0])

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
for i in range(n - 1):
    v.sort()
    tmp = (v.pop(0) + v.pop(0)) / 2
    v.append(tmp)
    if len(v) == 1:
        break


print(v[0])

Submission status: Accepted

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

v = sorted(v)

mean = v[0]

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

print(mean)

Submission status: Accepted

Solution code:
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y

N=II()
Vs=LI()
Vs.sort()

value = Vs[0]
for i in range(1, N):
    value = (value + Vs[i]) * 0.5

print(value)

Submission status: Accepted

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

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

if __name__ == '__main__':
    main()

Submission status: Accepted

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

buf=sorted(v)

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

print(buf[-1])

Submission status: Accepted

Solution code:
def ans(H):
  if len(H) == 2:
    return (H[0]+H[1])/2
  else:
    n = len(H)
    return (ans(H[0:n-1])+H[n-1])/2

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

print(ans(H))

Submission status: Accepted

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

for n in range(N):
    if n != N-1:
        s += v[n] / (2 ** (n+1))
    else :
        s += v[n] / (2 ** n)

print(s)

Submission status: Accepted

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

Submission status: Accepted

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


if __name__ == '__main__':
    main()

Submission status: Accepted

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

while len(v) >= 2:
  a = heapq.heappop(v)
  b = heapq.heappop(v)
  heapq.heappush(v,(a+b)/2)
  
print(heapq.heappop(v))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys

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

    new_Vs = sorted(Vs)

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

    print(sol)

main()

Submission status: Accepted

Solution code:
num = int(input())
val = list(map(int,input().split()))

val.sort()

while len(val) > 1:
    val[0] = (val[0]+val[1])/2
    val.pop(1)

print(val[0])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    v = list(map(int, input().split(" ")))
    while len(v) > 1:
        v.sort(reverse=True)
        a = v[-1]
        b = v[-2]
        v = v[:-2]
        v.append((a + b) / 2)
    print(v[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

vi.sort()

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

Submission status: Accepted

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

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

print(answer)

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

Submission status: Accepted

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

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
    v[i] = 0

print(sum(v))

Submission status: Accepted

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

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

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:
from collections import deque
n = int(input())
value = list(map(int, input().split(" ")))
value.sort()
value = deque(value)
que = deque()
ans = 0
a = value.popleft()
b = value.popleft()
c = (a+b)/2
que.append(c)
while value:
  a = value.popleft()
  c = que.popleft()
  c = (a+c)/2
  que.append(c)
ans = que[0]
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
v=sorted(list(map(int,input().split())),reverse=False)
#print(v)
ave=v.pop(0)
while True:
  tmp=v.pop(0) 
  ave=(ave+tmp)*0.5
  if len(v)==0:
    print(ave)
    exit()

Submission status: Accepted

Solution code:
from heapq import *

n=int(input())
inputs=lambda:map(int,input().split())
v=inputs()
u=[]
for i in v:
  heappush(u,i)
for j in range(n-1):  
  a1=heappop(u)
  a2=heappop(u)
  ave=(a1+a2)/2
  heappush(u,ave)
print(u[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

if __name__ == "__main__":
    main()

Submission status: Accepted

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

A = 0
B = 0

while len(v_i) != 1:
    A = min(v_i)
    del v_i[v_i.index(A)]
    B = min(v_i)
    del v_i[v_i.index(B)]
    v_i.append((A + B) / 2)

print(v_i[0])

Submission status: Accepted

Solution code:
import functools


input()
v = [int(i) for i in input().split()]
v.sort()
ans = functools.reduce(lambda x, y: (x + y) / 2, v)
print(ans)

Submission status: Accepted

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

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

print(l[-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
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
  v[i-1]=0
print(sum(v))

Submission status: Accepted

Solution code:
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.pop(0)
	v.pop(0)
	v.insert(0,tmp)

print(v[0])

Submission status: Accepted

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

V.sort()


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

print(ans)

Submission status: Accepted

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

ls_sv = sorted(ls_v)
ans = ls_sv[0]

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

v.sort()
v.reverse()

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

a += v[-1]/(2**(n-1))

print(a)

Submission status: Accepted

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

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