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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

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

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

Submission status: Accepted

Solution code:
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, groupby
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()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N = INT()
v = LIST()

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

Submission status: Accepted

Solution code:
N=int(input())
v=[int(x) for x in input().rstrip().split()]
v.sort()
ans=0
now=(v[0]+v[1])/2
if 2<=N:
  for i in range(2,N):
    now=(now+v[i])/2

print(now)

Submission status: Accepted

Solution code:
# solution
import io
import math

data = int(input())
array = [int(x) for x in input().split()]
array.sort()
for i in range(1,data):
  array[:2] = [(array[0]+array[1])/2]

print(array[0])

Submission status: Accepted

Solution code:
import sys

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce


def main():
    N = int(input())
    v = sorted(list(map(int, input().split())))
    print(reduce(lambda x, y: (x + y) * 0.5, v))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
v.sort(reverse=False)
ans = (v[0]+v[1])/2
if n >= 3:
    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()))

m1=min(v)
v.remove(m1)
for i in range(N-1):
    m2=min(v)
    v.remove(min(v))
    m1=(m1+m2)/2
print(m1)

Submission status: Accepted

Solution code:
n = int(input())
v_inputs =[int(i) for i in input().split()]

while v_inputs:
    if len(v_inputs)==1:
        print(v_inputs[0])
        break
    v_inputs = sorted(v_inputs)
    x=v_inputs.pop(0)
    y=v_inputs.pop(0)
    v_inputs.append((x+y)/2)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
v = [int(i) for i in 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:
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list
#from itertools import combinations # (string,3) 3回
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def main():
    n = int(input())
    V = sorted(readInts())
    pre_ = (V[0] + V[1])/2
    if n == 2:
        print(pre_)
        exit()
    else:
        for i in range(2,n):
            pre_ = (pre_ + V[i])/2
    print(pre_)
if __name__ == '__main__':
  main()

Submission status: Accepted

Solution code:
import heapq
n = int(input())
a = sorted(list(map(float, input().split())))
heapq.heapify(a)
for i in range(n-1):
    x = heapq.heappop(a)
    y = heapq.heappop(a)
    heapq.heappush(a, (x+y)/2)
print(a[0])

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

v.sort()

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import sys
sys.setrecursionlimit(10 ** 9)
input = sys.stdin.readline
from itertools import permutations,  combinations, accumulate
from functools import *
from collections import deque, defaultdict, Counter
from heapq import heapify, heappop, heappush, heappushpop

INF = float('inf')
NIL = - 1

""" Input
S = input().rstrip()
N, A, B = map(int, input().split())
D = [int(input()) for _ in range(N)]
"""

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

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

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


print(total)





# def main():


# if __name__ == '__main__':
#     main()

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

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

print(v[0])

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:
from heapq import heapify, heappop, heappush
N = int(input())
v = list(map(int, input().split()))
heapify(v)
while len(v)>1:
    newfood = heappop(v) + heappop(v)
    heappush(v, newfood/2)
print(heappop(v))

Submission status: Accepted

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

Submission status: Accepted

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

lis = sorted(v)

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

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

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

Submission status: Accepted

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

print(b)

Submission status: Accepted

Solution code:
n = int(input())
v = sorted(map(int, input().split()))
ret = v[0]
for i in range(1, n):
    ret = (ret + v[i]) * 0.5
print(ret)

Submission status: Accepted

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

V.sort()
ans = 0.

if N == 2:
  ans = sum(V) / 2.
  print(ans)
  exit()
  
for i in range(N):
  if i == 0:
    ans += V[i] / pow(2,N-1)
  else:
    ans += V[i] / pow(2,N-i)
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

v = a[0]
for b in a[1:]:
    v = (v + b) / 2
print(v)

Submission status: Accepted

Solution code:
N = int(input())
V = [int(s) for s in input().split(' ')]
V.sort()
value = V[0]
for v in V[1:]:
    value = (value + v) / 2
print(value)

Submission status: Accepted

Solution code:
import os, sys, re, math

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

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

print(v)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
N = int(input())
V = sorted([int(s) for s in input().split()])
total_value = V[0]
for i in range(1, N):
    total_value = (total_value + V[i]) / 2

print(total_value)

Submission status: Accepted

Solution code:
from functools import reduce

n = int(input())
v = sorted([int(i) for i in input().split()])
ret = reduce(lambda x, y: (x + y) / 2, v)
print (ret)

Submission status: Accepted

Solution code:
n = int(input())
aaa = sorted(list(map(int, input().split(' '))))  # 多分一番大きいのが /2 される回数が少ないにすると良い？
hoge = aaa[0]
for i in range(1, n):
    hoge = (hoge + aaa[i]) / 2
print(hoge)

Submission status: Accepted

Solution code:

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

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def solve():
    n = II()
    V = sorted(LI())
    ans = V[0]
    for i in range(1, n):
        ans = (ans + V[i]) / 2
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

from collections import deque

def solve():
    n = II()
    V = sorted(LI())
    ans = V[0]
    for i in range(1, n):
        ans = (ans + V[i]) / 2
    print(ans)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
# import sys
# sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

from collections import deque

def solve():
    n = II()
    V = LI()

    V = deque(sorted(V))

    vi = V.popleft()
    while 1:
        vj = V.popleft()
        avg = (vi + vj) / 2
        V.append(avg)
        V = deque(sorted(V))

        vi = V.popleft()
        if len(V) == 0:
            break
    print(vi)

if __name__ == '__main__':
    solve()

Submission status: Accepted

Solution code:
n=int(input())
a = sorted(map(int,input().split()))
p=a[0]
for i in range(1,n):
    p = (p + a[i])/2
print('{:.8f}'.format(p))

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

for _ in range(n-1):
    a = v.pop(0)
    b = v.pop(0)
    avg = (a + b) / 2
    v.insert(0, avg)

print(v[0])

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(v)

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

print(heapq.heappop(v))

Submission status: Accepted

Solution code:
from fractions import Fraction
n=int(input())
a=list(map(int,input().split()))

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

print(float(ans))

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
for _ in range(N - 1):
    V.sort(reverse=True)
    x = V.pop()
    y = V.pop()
    V.append((x + y) / 2)
print(V[0])

Submission status: Accepted

Solution code:
def Alchemist(n , vl):

    vl.sort()
    ans = vl[0]

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

    return ans

def main():
    n = int(input())
    vl = list(map(int , input().split()))
    print(Alchemist(n , vl))

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
N = int(input())
V = [_ for _ in map(int,input().split())]
v = len(V)
V.sort()
if v == 2:
    print(sum(V)/2)
else:
    i = 2
    X = (V[0] + V[1])/2
    while i != N:
        X = (X + V[i])/2
        i += 1
    print(X)

Submission status: Accepted

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

v.sort()

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

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

print(x)

Submission status: Accepted

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

if n == 2:
  print(sum(s) / 2)

else:
  m_v = 0
  for i in range(2, n):
    m_v += 2 ** (i - 1) * s[i]
    
  print((m_v + sum(s[:2])) / (2 ** (n - 1)))

Submission status: Accepted

Solution code:
import math

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

v.sort(reverse=True)

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

print(v[0])

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

Submission status: Accepted

Solution code:
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
printV = lambda x: print(*x, sep="\n")
printH = lambda x: print(" ".join(map(str,x)))
def IS(): return sys.stdin.readline()[:-1]
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LI1(): return list(map(int1, sys.stdin.readline().split()))
def LII(rows_number): return [II() for _ in range(rows_number)]
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def LLI1(rows_number): return [LI1() for _ in range(rows_number)]
mo = 10**9+7

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

if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
import numpy as np
import sys
n = int(input())
A= list(map(int,input().split()))
A.sort()
cnt = A[0]
for i in range(1,n):
    cnt = (cnt+A[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):
    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(N-1):
	ans=(ans+V[i+1])/2
print(ans)

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(v)
for i in range(n-1):
    v1 = heapq.heappop(v)
    v2 = heapq.heappop(v)
    heapq.heappush(v,(v1+v2)/2)
ans = heapq.heappop(v)
print(ans)

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().rstrip()
def main():
    n=int(input())
    V=[int(_) for _ in input().split()]
    V.sort()
    ss=V[0]
    for i in range(1,n):
        ss=(ss+V[i])/2
    print(ss)

if __name__=='__main__':
    main()

Submission status: Accepted

Solution code:
def myAnswer(N:int,V:list) -> float:
   ans = 0
   V.sort()
   while len(V)!=1:
      tmp = (V.pop(0)+V.pop(0))/2
      V.append(tmp)
      V.sort()

   return V[0]

def modelAnswer():
   tmp=1
def main():
   N = int(input())
   V = list(map(int,input().split()))
   print(myAnswer(N,V[:]))

if __name__ == '__main__':
   main()

Submission status: Accepted

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

nv = sorted(v)

for i in range(N-1):
    dammy = (nv[0] + nv[1]) / 2
    nv[1] = dammy
    del nv[0]
    nv = sorted(nv)

print(nv[0])

Submission status: Accepted

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

"""

n=int(input())
A=list(map(int,input().split()))
A.sort()
cur=(A[0]+A[1])/2

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

if __name__ == '__main__':
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from heapq import heapify, heappop, heappush

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

heapify(v)

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

Submission status: Accepted

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

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

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

print(point)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
V = list(map(int,input().split(' ')))
V.sort()
ans = 0
i = 1
while i < n+1:
    ans += V[n-i]/pow(2,i)
    i += 1
print(ans+V[0]/pow(2,n))

Submission status: Accepted

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

heapq.heapify(v)

while len(v)>1:
    tmp1 = heapq.heappop(v)
    tmp2 = heapq.heappop(v)
    heapq.heappush(v,(tmp1+tmp2)/2)
    
print(v[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

value = sorted(value)

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import Decimal
n = int(input())
v = list(map(int,input().split()))
sumv = sum(v)
for i in range(n-1):
    v.sort()
    sumv -= Decimal((v[0]+v[1])/2)
    v[1] = Decimal((v[0]+v[1])/2)
    v[0] = 1000000
print(sumv)

Submission status: Accepted

Solution code:
from heapq import heappop, heappush

n = int(input())
queue = []
for v in map(int, input().split()):
  heappush(queue, v)
for _ in range(n-1):
  v1 = heappop(queue)
  v2 = heappop(queue)
  heappush(queue, (v1 + v2) / 2)
print(queue[0])

Submission status: Accepted

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

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 = 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:
n = int(input())
v = list(map(int, input().split()))
v_new = sorted(v)
while len(v_new) > 1:
    s = [(v_new[0] + v_new[1]) / 2]
    v_new = s + v_new[2:]
print(sum(v_new))

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())
vn = list(map(int, input().split()))
vn.sort(reverse=True)
for _ in range(N-1):
    new = (vn[-1] + vn[-2])/2
    vn.pop()
    vn.pop()
    vn.append(new)
print(new)

Submission status: Accepted

Solution code:
import bisect

N = int(input())
v = list(map(int, input().split()))
v.sort()
for _ in range(N - 1):
    bisect.insort(v, (v.pop(0) + v.pop(0)) / 2)

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

ns=lambda:input().rstrip()
ni=lambda:int(input().rstrip())
nm=lambda:map(int,input().split())
nl=lambda:list(map(int,input().split()))


N=int(input())
V=nl()
h=[]
for i in V:
  heapq.heappush(h,i) 

for i in range(N-1):
  minval=heapq.heappop(h)
  minval2=heapq.heappop(h)
  heapq.heappush(h,(minval+minval2)/2)
  
print(heapq.heappop(h))

Submission status: Accepted

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

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

Submission status: Accepted

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

while len(sl) > 1:
    e1 = sl.pop()
    e2 = sl.pop()
    sl.append((e1 + e2)/2)
print(sl[0])

Submission status: Accepted

Solution code:
from functools import reduce

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

add = lambda a, b: a + b
sum = lambda list: reduce(add, list, 0)

v.sort()

v0 = v[0] / 2 ** (len(v) - 1)
v.pop(0)

total = v0 + sum([vi / 2 ** (len(v) - i) for i, vi in enumerate(v)])

print(total)

Submission status: Accepted

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

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

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
u=list(map(int,input().split()))
u.sort()
ans=0

while len(u)>=2:
  ans=(u[0]+u[1])/2
  del u[0]
  u[0]=ans
  
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
v=sorted(map(int,input().split()))
while True:
    x=v.pop(0)
    y=v.pop(0)
    v.append((x+y)/2)
    v.sort()
    if len(v)==1:
        break
print(v[0])

Submission status: Accepted

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

v.sort()

for i in range(len(v)):
    if i==0:
        continue

    a = v.pop(1)
    b = v.pop(0)
    v.insert(0, (a+b)/2)


print(v[0])

Submission status: Accepted

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

#print(slist)
score=0
while len(slist)>=2:
	m1 = min(slist)
	slist.remove(m1)
	m2 = min(slist)
	slist.remove(m2)
#	print(m1,m2)
	slist.append((m1+m2)/2)
#	print((m1+m2)/2)
#	print(slist)
print(slist[0])

Submission status: Accepted

Solution code:
import functools


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


def main():
    n = int(input())
    v = [int(x) for x in input().split()]

    v.sort()
    max_value = functools.reduce(new_ingredient, v)

    print(max_value)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
#!/usr/bin/env python3

import sys
# import math
# import re                                    # re.compile(pattern) => ptn obj; p.search(s), p.match(s), p.finditer(s) => match obj; p.sub(after, s)
# from collections import deque                # deque class. deque(L): dq.append(x), dq.appendleft(x), dq.pop(), dq.popleft(), dq.rotate()
# from collections import defaultdict          # subclass of dict. defaultdict(facroty)
# from collections import Counter              # subclass of dict. Counter(iter): c.elements(), c.most_common(n), c.subtract(iter)
# from heapq import heapify, heappush, heappop # built-in list. heapify(L) changes list in-place to min-heap in O(n), heappush(heapL, x) and heappop(heapL) in O(lgn).
# from heapq import nlargest, nsmallest        # nlargest(n, iter[, key]) returns k-largest-list in O(n+klgn).
# from itertools import product                # product(iter, repeat=n)
# from itertools import accumulate             # accumulate(iter[, f])
# from functools import reduce                 # reduce(f, iter[, init])
# from bisect import bisect_left, bisect_right # bisect_left(a, x, lo=0, hi=len(a)) returns i such that all(val<x for val in a[lo:i]) and all(val>-=x for val in a[i:hi]).
# from fractions import gcd                    # for Python3.4.3


def main():
    mod = 10000007                  # 10^9+7
    inf = float('inf')
    input = sys.stdin.readline      # 改行文字が残ることに注意
    sys.setrecursionlimit(10**6)    # 1000 -> 1000000
    def ii():  return int(input())
    def mi():  return map(int, input().rstrip().split())
    def lmi(): return list(map(int, input().rstrip().split()))
    def li():  return list(input().rstrip())
    
    
    n = ii()
    v = sorted(lmi())
    ans = (v[0] + v[1]) / 2
    for i in range(2, n):
        ans = (ans + v[i]) / 2
    print(ans)

if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
from collections import deque
from collections import Counter
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
#pypyではscipy, numpyは使えない
#from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
#from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial, log, log10, log2
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
from datetime import datetime as dt

def main():
  n = int(readline())
  v = list(map(int, readline().split()))
  v.sort()
  total = 0
  for i in range(n):
    if i == 0:
      total += v[i]
    else:
      total += (2**(i-1))*v[i]
  print(total/(2**(n-1)))
  
  
  
if __name__ == '__main__':
  main()