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

V.sort()
out = V[0]
for i in range(n - 1):
    j = i + 1
    out = (out + V[j]) / 2
print(out)

Submission status: Accepted

Solution code:
import functools

n = int(input())
V = sorted(map(int, input().split()))
ans = functools.reduce(lambda x, y: (x + y) / 2, V)
print(ans)

Submission status: Accepted

Solution code:
import sys, math
input = sys.stdin.readline
rs = lambda: input().strip()
ri = lambda: int(input())
rl = lambda: list(map(int, input().split()))
mod = 10**9 + 7

N = ri()
V = rl()

import heapq

heap = []
for v in V:
	heapq.heappush(heap, v)

while len(heap) >= 2:
	v = heapq.heappop(heap)
	v2 = heapq.heappop(heap)
	nv =(v + v2)/2
	heapq.heappush(heap, nv)
print(heap[0])

Submission status: Accepted

Solution code:
def main():
    N = int(input())
    V = list(map(int, input().split()))
    while len(V) > 1:
        V.sort()
        new_v = sum(V[0:2]) / 2
        V = V[2:]
        V.append(new_v)
    print(V[0])


if __name__ == '__main__':
    main()

Submission status: Accepted

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

v = sorted(v)

while len(v) != 1:
    v[1] = (v[0] + v[1]) / 2
    v.pop(0)

print(v[0])

Submission status: Accepted

Solution code:
import heapq


def main():
    n = int(input())
    v = list(map(float, input().split()))
    heapq.heapify(v)
    while True:
        a = heapq.heappop(v)
        if not len(v):
            print(a)
            return
        b = heapq.heappop(v)
        heapq.heappush(v, (a + b) / 2)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
V = [int(i) for i in input().split()]
V.sort(reverse=True)
while len(V) != 1:
    a,b = V.pop(), V.pop()
    V.append((a+b)/2)
print(V[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
V.sort()
res = 0.5 * (V[0] + V[1])
for i in range(2, N):
    res = 0.5 * (res + V[i])
print(res)

Submission status: Accepted

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

Submission status: Accepted

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

while True:
  ans = 0
  ans += (v[0] + v[1])/2
  if len(v) == 2:
    break
  else:
    v.pop(0)
    v.pop(0)
    v.insert(0, ans)
print(ans)

Submission status: Accepted

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

V.sort()
avg=V[0]
for i in range(n):
  avg = (avg +V[i]) /2
  
print(avg)

Submission status: Accepted

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

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]
  ans /= 2
print(ans)

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

ans = (vl[0]+vl[1])/2
if len(vl) == 2:
    print(ans)
    exit()

for v in vl[2:]:
    ans = (ans + v)/2

print(ans)

Submission status: Accepted

Solution code:
from functools import reduce
N = int(input())
V = sorted(list(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.sort()

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

Submission status: Accepted

Solution code:
import collections

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

v.sort()

v = collections.deque(v)

ans = v.popleft()

for i in range(n-1):
    a = v.popleft()
    ans = (ans + a)/2

print(ans)

Submission status: Accepted

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

V_Asc = sorted(V)

ans = 0 
for v in V_Asc:
    ans = (ans + v )/2 if ans != 0 else v
    last = v

print(ans)

Submission status: Accepted

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

for i in range(N - 1):
    v1 = v.pop(0)
    v2 = v.pop(0)
    v.append((v1 + v2) / 2)
    v.sort()
print(v[0])

Submission status: Accepted

Solution code:
def resolve():
    '''
    code here
    '''
    N = int(input())
    As = [int(item) for item in input().split()]

    As.sort()

    res = As[0]
    for i in As[1:]:
        res = (res + i)/2
    print(res)
if __name__ == "__main__":
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from math import gcd
n=int(input())
v=list(map(int,input().split()))
v.sort()
ans=v[0]/(2**(n-1))
div=2**n
for i in range(1,n):
    div/=2
    ans+=v[i]/div

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
input()
p,*v=sorted(map(int,input().split()))
for x in v:p=(p+x)/2
print(p)

Submission status: Accepted

Solution code:
input()
p,*v = sorted(list(map(int,input().split())))
for x in v:p=(p+x)/2
print(p)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#heapq復習
import heapq
n = int(input())
v = list(map(int,input().split()))
heapq.heapify(v)
x = 0
while v:
  x = heapq.heappop(v)
  if not v:
    break
  y = heapq.heappop(v)
  heapq.heappush(v,(x+y)/2)
print(x)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int,input().split()))
v = sorted(v)
while len(v) != 1:
    v[1] = (v[0]+v[1])/2
    v = sorted(v[1:])
print(*v)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
v = sorted(v)
while len(v) != 1:
  v[1] = (v[0]+v[1])/2
  v = sorted(v[1:])
print(*v)

Submission status: Accepted

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

Submission status: Accepted

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

V.sort()
sum = 0
for i,v in enumerate(V):
    if i == 0:
        sum += v
    sum = float((sum + v) / 2)

print(sum)

Submission status: Accepted

Solution code:
from fractions import Fraction

n, *xx = map(Fraction, open(0).read().split())

a, b, *xx = sorted(xx)

ans = (a+b)/2

for x in xx:
    ans = (ans+x)/2

print(float(ans))

Submission status: Accepted

Solution code:
n = int(input())

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

v.sort(reverse = True)

while len(v) > 1 :
    v.append((v.pop(-1) + v.pop(-1))/2)
    v.sort(reverse = True)

print(v[0])

Submission status: Accepted

Solution code:
input()
X = sorted(list(map(int, input().split())))
p = X[0]
for x in X[1:]:
  p = (p+x)/2
print(p)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heapify,heappush,heappop

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

while len(V)>=2:
    a=heappop(V)
    b=heappop(V)
    heappush(V,(a+b)/2)

c=heappop(V)
print(c)

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

Submission status: Accepted

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

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

print(v[0])

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v_li = [int(w) for w in input().split()]

v_li.sort()

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# n, m, l = map(int, input().split())

# list_n = list(map(int, input().split()))

# n = input()
# list = [input() for i in range(N)

# list = [[i for i in range(N)] for _ in range(M)]

import sys
input = sys.stdin.readline

N = int(input())
list_V = list(map(float, input().split()))
list_V.sort()

n = 0.0
while len(list_V) >= 2:
    list_V.sort()
    n = (list_V[0] + list_V[1])/2
    list_V.append(n)
    list_V.pop(0)
    list_V.pop(0)

print(list_V[0])

Submission status: Accepted

Solution code:
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    v = sorted(list(map(int, input().split())))
    for _ in range(n-1):
        v.append((v.pop(0) + v.pop(0)) / 2)
        v.sort()
    print(*v)

if __name__ == '__main__':
    main()

Submission status: Accepted

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

print( int(value) if value%1==0 else value)

Submission status: Accepted

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

for _ in range(n-1):
    x = v[0]
    y = v[1]
    num = (x+y)/2
    del v[0]
    v[0] = num

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

while len(v) > 1:
    x = v.pop()
    y = v.pop()
    v.append((x + y) / 2)
    v.sort(reverse=True)

print(*v)

Submission status: Accepted

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

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

print(*v)

Submission status: Accepted

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

Submission status: Accepted

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

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

a = v[0]

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


print(a)

Submission status: Accepted

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

v.sort()

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

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


print(a)

Submission status: Accepted

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

vn.sort()

a = (vn[0]+vn[1])*0.5

for i in range(2, n):
    a = (a+vn[i])*0.5


print(a)

Submission status: Accepted

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

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

Submission status: Accepted

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

A.sort(reverse = True)

while len(A) > 1:
  x = A[-1]
  A.pop()
  y = A[-1]
  A.pop()
  A.append((x + y) / 2)
  A.sort(reverse = True)

print(A[0])

Submission status: Accepted

Solution code:
import sys

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

n, *v = map(int, read().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()

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# FileName: 	C
# CreatedDate:  2020-06-25 17:30:38 +0900
# LastModified: 2020-06-25 21:19:30 +0900
#


import os
import sys
# import numpy as np
# import pandas as pd


def main():
    n = int(input())
    v = list(map(int, input().split()))
    v.sort(reverse=True)
    while len(v) != 1:
        s = v.pop()
        t = v.pop()
        v.append((s+t)/2)
    print(v[0])


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(N-1):
    x = V.pop()
    y = V.pop()
    V.append((x + y) / 2)
    V.sort(reverse=True)
print(*V)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
a=[0]*n
for i in range(n):
    t=0
    for j in range(n):
        if v[i]>v[j]:
            t+=1
    a[t]=v[i]
for i in range(n):
    if a[i]==0:
        a[i]=a[i-1]
m=0
for i in range(1,n):
    m+=a[i]/(2**(n-i))
print(m+(a[0]/(2**(n-1))))

Submission status: Accepted

Solution code:
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *V = map(int, read().split())

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

    print(ans)
    return


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

if __name__ ==  "__main__":
    main()

Submission status: Accepted

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

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

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

print(v[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

v.sort()

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

print(total)

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 += v[i]
    ave = ave / 2
print(ave)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
v = list(map(int,input().split()))
v.sort(reverse=True)
stack = deque()
for i in v:
    stack.append(i)
while stack:
    if len(stack) == 1:
        print(stack.pop())
    else:
        small1 = stack.pop()
        small2 = stack.pop()
        tmp = (small1 + small2)/2
        stack.append(tmp)

Submission status: Accepted

Solution code:
import heapq
N = int(input())
S = list(map(int, input().split()))
heapq.heapify(S)

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

print(heapq.heappop(S))

Submission status: Accepted

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

ans=v.pop()
for i in range(n-1):
  tt=v.pop()
  ans=(ans+tt)/2
print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in 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:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
Vs = list(mapint())
Vs.sort()
x = Vs[0]
for v in Vs[1:]:
    x = (x+v)/2
print(x)

Submission status: Accepted

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

vl.sort()
#print(vl)

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

print(tmp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

N = int(readline())
V = sorted(list(map(int,readline().split())))

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())
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:
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10**6)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

V.sort()
ans=(V[0]+V[1])/2
i=2
while i<N:
    ans=(ans+V[i])/2
    i+=1

print(ans)

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
v.sort()
ans=(v[0]+v[1])/2
cnt=2
while cnt<len(v):
  ans=(ans+v[cnt])/2
  cnt+=1
  
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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