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:
#!/usr/bin/env python3
import sys
# import math
# import numpy as np
# from functools import lru_cache

args = sys.argv
if len(args) == 2:
  from IPython import embed
  em = True
else:
  em = False

# sys.setrecursionlimit(10000)

#### input
N = int(input())
# a, b = map(int, input().split())
vs = list(map(int, input().split()))
# vs = list(map(lambda x: int(x)*(2**(N - 1)), vs_orig))  # 各要素を-1倍

# n = int(input())
# t = [int(input()) for i in range(n)]
if em: sys.stdin = open('/dev/tty')
if em : embed()

#### function
# @lru_cache(maxsize=10000)

#### process
vs_sorted = sorted(vs)
vs_sum = vs_sorted[0]

for i in range(1, len(vs_sorted)):
  vs_sum = vs_sum + 2**(i-1) * vs_sorted[i]

print(vs_sum / 2**(N-1))
# if em: embed()

## heapsort, O(NlogN)
# import heapq
# # As = [0,1,2,3]
# heapq.heapify(vs)
# min1 = heapq.heappop(vs)
# min2 = heapq.heappop(vs)
# heapq.heappush(vs, )

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:
N = input()
a = input().split()

a = [float(i) for i in a]#float cast
p = 1
list.sort(a)
#print("初期値"+ str(a))
N = int(N)
for j in range(N-1):
    sum = a[j]
    for i in range(1):
        sum = sum + a[p]
        ans = sum / 2
        a[p] = ans
        p += 1
    list.sort(a)
    #print(str(j) + "回目:" + str(a))

ans = sum / 2
print(ans)

Submission status: Accepted

Solution code:
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    a= heappop(L)
    b= heappop(L)
    s=(a+b)/2
    heappush(L,s)
print(s)

Submission status: Accepted

Solution code:
n = input()
v = list(map(int,input().split()))
while len(v) > 1:
  v = sorted(v)
  v1 = v.pop(0)
  v2 = v.pop(0)
  v.append((v1+v2)/2)
print('%.5f' %(v[0]))

Submission status: Accepted

Solution code:
if __name__ == '__main__':

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

	#元のリストをソート
	A.sort()

	num = 0
	for i in range(n-1):
		if i == 0:
			num = ( A[i] + A[i+1] ) / 2
		else:
			num = ( num + A[i+1]  ) / 2

	print(num)

Submission status: Accepted

Solution code:
def slove():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    v = list(map(int, input().rstrip('\n').split()))
    v.sort()
    t = 0
    for i in range(n):
        if i != 0:
            t = (t + v[i]) / 2
        else:
            t += v[i]
    print(t)


if __name__ == '__main__':
    slove()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
v_list = list(map(int, input().split()))
v_list.sort()
sum = 0
for index in range(len(v_list)):
  if not index == 0:
    keisuu = pow(0.5, n-index)
  else:
    keisuu = pow(0.5, n-1)
  sum += (keisuu * v_list[index])
print(sum)

Submission status: Accepted

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

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

v_list.sort()

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

Submission status: Accepted

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

v.sort()

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

print(v[-1])

Submission status: Accepted

Solution code:
import heapq

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


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

print(v[0])

Submission status: Accepted

Solution code:
n=int(input())
v=[]*n
v[:]=sorted(map(int,input().split()))
a=0
for i in range(n):
  if i==0:
    a+=v[i]
  else:
    a=float((a+v[i])/2)
print(a)

Submission status: Accepted

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

Submission status: Accepted

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

V.sort()

temp = V[0]
for n in range(N):
    temp = (V[n] + temp)/2

print(round(temp, 6))

Submission status: Accepted

Solution code:

def main():
    A = int(input())
    K = [int(x) for x in input().split()]
    K = sorted(K)
    ans = K[0]
    for idx in range(1, A):
        ans = (ans + K[idx])*0.5
    print(ans)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(new[n-1])

Submission status: Accepted

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

sort_lst = sorted(sozai_lst)

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

print(sort_lst[0])

Submission status: Accepted

Solution code:
from sys import stdin

N = int(stdin.readline())
v = list(map(int, stdin.readline().split()))

v.sort()

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

print(value)

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

print(v[N-1])

Submission status: Accepted

Solution code:
from __future__ import print_function
# import numpy as np
# import numpypy as np
import sys
input = sys.stdin.readline

def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

import math
import string
import fractions
from fractions import Fraction
from fractions import gcd

def lcm(n,m):
    return int(n*m/gcd(n,m))

import re
import array
import copy
import functools
import operator

import collections
import itertools
import bisect
import heapq


from heapq import heappush
from heapq import heappop
from heapq import heappushpop
from heapq import heapify
from heapq import heapreplace

from queue import PriorityQueue as pq

def reduce(p, q):
    common = fractions.gcd(p, q)
    return (p//common , q//common )
# from itertools import accumulate
# from collections import deque

import random


def main():
    n = int(input())
    v = list(map(int, input().split()))
    v.sort()                    # increasing way
    # eprint(v)

    sum=0
    sum+=v[0]+v[1]
    
    for i in range(2,n):        # i is index of the ingredients.
        coef = i-1
        # eprint("coef "+str(coef))
        sum += pow(2,coef) * v[i]
        # eprint("sum "+str(sum))

    print(sum/pow(2,n-1))
    return

if __name__ == '__main__':
    main()

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:
from functools import reduce

if __name__ == "__main__":
    n = int(input())
    ingredients = list(map(float, input().split()))
    ingredients.sort()
    print(reduce((lambda x, y: (x + y) / 2), ingredients))

Submission status: Accepted

Solution code:

import heapq


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

heapq.heapify(V)

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

ans = heapq.heappop(V)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
# n個の具材
# i個目の価値はvi
# 2個の具材を入れると価値は元の具材の価値の平均
# 全部合成した後の価値の最大値

# 合成を重ねると価値が下がるので価値の低いものから合成していく

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

print(value)

Submission status: Accepted

Solution code:
import heapq
n = int(input())
v = list(map(int, input().split()))
heapq.heapify(v)
while len(v) > 1:
  num1 = heapq.heappop(v)
  num2 = heapq.heappop(v)
  heapq.heappush(v, (num1 + num2) / 2)
print(v[0])

Submission status: Accepted

Solution code:
# 価値の低い2つから順に合成すればよい
import heapq

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

while len(v_l) > 1:
    heapq.heapify(v_l)
    tmp1 = heapq.heappop(v_l)
    tmp2 = heapq.heappop(v_l)
    heapq.heappush(v_l, (tmp1+tmp2)/2)

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
values = list(map(int, input().strip().split()))
total = 0
values.sort()
step = 0
#print(values)
while len(values) > 1:
    new = (values[step] + values[step + 1]) / 2
    del values[0]
    del values[0]
    values = [new] + values
    #print(values)
print(values[0])

Submission status: Accepted

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

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:
def solve():
    N, *vl = map(float, open(0).read().split())
    vl.sort()
    
    for _ in range(int(N)-1):
        a, b = vl[0], vl[1]
        vl[1] = (a + b) / 2
        vl = vl[1:]
    
    print(vl[0])

if __name__ == '__main__':
    solve()

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
Values=list(map(int,input().split()))
Values=sorted(Values)
i=1
while i<=n-1:
    x=Values.pop(0)
    y=Values.pop(0)
    new=(x+y)/2
    Values.append(new)
    Values=sorted(Values)
    i+=1
print(*Values)

Submission status: Accepted

Solution code:
import heapq as hq
N = int(input())
V = [int(i) for i in input().split()]
hq.heapify(V)
for i in range(N-1):
    a = hq.heappop(V)
    b = hq.heappop(V)
    hq.heappush(V,(a+b)/2)
print(V[0])

Submission status: Accepted

Solution code:
import heapq
n = int(input())
x=0
d=list(map(int,input().split()))
while len(d)>=2:
    d.sort()
    x=(d[0]+d[1])/2
    heapq.heappop(d)
    heapq.heappop(d)
    d.append(x)
print(x)

Submission status: Accepted

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

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

print(avg)

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

print(ans[-1])

Submission status: Accepted

Solution code:
N=int(input())

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

v.sort()
price=v[0]

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

print(price)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    v = sorted([int(i) for i in open(0).read().split()[1:]])
    ans = v[0]
    for i in v[1:]:
        ans = (ans + i) * 0.5
    print(ans)
    return


main()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    v = sorted([int(i) for i in open(0).read().split()[1:]])
    ans = None
    for i in v:
        if ans:
            ans = (ans + i) * 0.5
        else:
            ans = i
    print(ans)
    return


main()

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from functools import reduce

N = int(input())
l = sorted(list(map(int, input().split())))
result = reduce(lambda a,b: (a + b) / 2, l)

print(result)

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):
    x=heapq.heappop(v)
    y=heapq.heappop(v)
    heapq.heappush(v,(x+y)/2)
print(heapq.heappop(v))

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())
a=sorted(map(int,input().split()))
mean = a[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:
n = int(input())
v = sorted([int(i) for i in input().split()],reverse=True)
while len(v) != 1:
    a = v.pop()
    b = v.pop()
    v.append((a+b)/2)
print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

n = int(input())
item = [int(i) for i in input().split()]
heapq.heapify(item)

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

print(item[0])

Submission status: Accepted

Solution code:
a = int(input())
arr = sorted(list(map(int, input().split())))[::-1]
while len(arr) != 1:
    x = arr.pop()
    y = arr.pop()
    arr.append((x+y)/2)
print(arr[0])

Submission status: Accepted

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

while len(v) != 1:
    min_1 = min(v)
    del v[v.index(min_1)]
    min_2 = min(v)
    del v[v.index(min_2)]
    v.append((min_1 + min_2)/2)
    
print (v[0])

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

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

for i in range(N - 1):
    v = sorted(v, reverse=True)
    m1 = v.pop()
    m2 = v.pop()
    v.append((m1 + m2) / 2)

print(v[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import heapq

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

h = []
for value in v:
  heapq.heappush(h, value)

for i in range(n-1):
  v1 = heapq.heappop(h)
  v2 = heapq.heappop(h)
  mixed = (v1 + v2) / 2
  heapq.heappush(h, mixed)

print(h[0])

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

Submission status: Accepted

Solution code:
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sys,collections,itertools,re,math,fractions,decimal,random,array,bisect,heapq

# decimal.getcontext().prec = 50
# sys.setrecursionlimit(10000)
# MOD = 10**9 + 7

def solve(f):
    n = f.read_int()
    v = f.read_int_list()

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

    return ans


class Reader(object):
    def __init__(self, filename=None):
        self.file = open(filename) if filename is not None else None
        self.case = 1

    def __readline(self):
        return self.file.next().strip() if self.file else raw_input()

    def next_case(self):
        self.file.next()
        self.case += 1

    def read_int(self): return int(self.__readline())
    def read_float(self): return float(self.__readline())
    def read_long(self): return long(self.__readline())
    def read_decimal(self): return decimal.Decimal(self.__readline())
    def read_str(self): return self.__readline()

    def read_int_list(self): return map(int, self.__readline().split())
    def read_float_list(self): return map(float, self.__readline().split())
    def read_long_list(self): return map(long, self.__readline().split())
    def read_decimal_list(self): return map(decimal.Decimal, self.__readline().split())
    def read_str_list(self): return self.__readline().split()

if __name__ == '__main__':
    filename = sys.argv[1] if len(sys.argv) > 1 else None
    f = Reader(filename)
    if f.file:
        while True:
            print "Case #%d\n"%f.case, solve(f)
            try:
                f.next_case()
            except StopIteration:
                break
    else:
        print solve(f)

Submission status: Accepted

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

print(v[n-1])

Submission status: Accepted

Solution code:
#input : 整数N、N個の値v_i
#output : vの中から２つを選び取り平均をとっていく、最終的に残った値の最大値を出力する

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

for i in range(N-1):
    n = (v.pop(0) + v.pop(0))/2
    v.insert(0,n)

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
V = [int(e) for e in input().split()]
while len(V) != 1:
  V.sort()
  tmp = V[0] + V[1]
  del V[0]
  del V[0]
  V.append(tmp/2)

print(V[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

r = V[0]

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

Submission status: Accepted

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

V.sort()
result = (V[0] + V[1]) / 2

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

Submission status: Accepted

Solution code:
import decimal

n = int(input())
arr = list(map(decimal.Decimal, input().split()))

arr.sort()

while len(arr) > 1:

    s = decimal.Decimal(0)

    s += arr.pop(0)
    s += arr.pop(0)

    arr.append(s / 2)

    arr.sort()

print(arr[0])

Submission status: Accepted

Solution code:
n = int(input())

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


v.sort()

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

result = tem/(2**(n-1))
print(result)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = II()
    s = input()
    print(s if a >= 3200 else "red")
    return

#B
def B():
    II()
    a = LI()
    ans = 0
    for ai in a:
        ans += 1 / ai
    print(1/ans)
    return

#C
def C():
    n = II()
    v = LI()
    q = []
    for vi in v:
        heappush(q, vi)
    while 1:
        a = heappop(q)
        if q:
            b = heappop(q)
            heappush(q, (a + b) / 2)
        else:
            print(a)
            return

#D
def D():
    n, q = LI()
    tree = [[] for i in range(n)]
    for _ in range(n - 1):
        a, b = LI_()
        tree[a].append(b)
        tree[b].append(a)
    ans = [0] * n
    c = defaultdict(int)
    def dfs(now):
        for nex in tree[now]:
            if c[nex]:
                continue
            c[nex] += 1
            ans[nex] += ans[now]
            dfs(nex)
    for _ in range(q):
        p, x = LI_()
        x += 1
        ans[p] += x
    c[0] = 1
    dfs(0)
    print(*ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    C()

Submission status: Accepted

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

Submission status: Accepted

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

mix_parts = (v_list.pop(0) + v_list.pop(0)) / 2

while True:
    try:
        mix_parts = (mix_parts + v_list.pop(0)) / 2
    except IndexError:
        break

print(mix_parts)

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

sorted_vs = sorted(vs)

ans = sorted_vs[0]

for vs in sorted_vs[1:]:
    ans = (ans + vs) / 2

print(ans)

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(v)
work = heapq.heappop(v)

for _ in range(n - 1):
    work += heapq.heappop(v)
    work /= 2

print(work)

Submission status: Accepted

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

m = min(lis)
lis.remove(min(lis))
m_2 = min(lis)
lis.remove(min(lis))
v = (m + m_2) / 2   

for i in range(0, N - 2):
    v = (v + min(lis)) / 2
    lis.remove(min(lis))

print(v)

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(1, N):
    a = heappop(v)
    b = heappop(v)
    heappush(v, (a+b)/2)

print(v[0])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

lis_v.sort()

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


print(lis_v[0])

Submission status: Accepted

Solution code:
n=int(input())
l=[float(i) for i in input().split()]
l.sort()
while len(l)>1:
    # print(l)
    a,b=l[0],l[1]
    av=(a+b)/2
    del l[0]
    del l[0]
    l.append(av)
    l.sort()
print(l[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = list(map(int, input().split()))
while 1 < len(l):
    l = sorted(l, reverse=True)
    m = (l.pop() + l.pop()) / 2
    l.append(m)
print(l[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):
    min_1 = heapq.heappop(V)
    min_2 = heapq.heappop(V)
    ave = (min_1 + min_2)/2
    heapq.heappush(V, ave)
print(V[0])

Submission status: Accepted

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

Submission status: Accepted

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

v_sort = sorted(v)

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

print(temp)

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:
n = int(input())
v = list(map(int,input().split()))
minimum1 = 0
#minimum1_id = 0
minimum2 = 0
#minimum2_id = 0

for i in range(n-1):
    ans = 0
    minimum1 = min(v)
    del v[v.index(minimum1)]
    minimum2 = min(v)
    del v[v.index(minimum2)]
    ans = ans+((minimum1+minimum2)/2)
    v.append(ans)
#    print(v)

print(v[0])

Submission status: Accepted

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

answer = li_v[0]

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

Submission status: Accepted

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

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

result = 0
tmp = v_sort[0]
for i in range(N-1):
   tmp = float((1/2)*(tmp+v_sort[i+1]))

print(tmp)

Submission status: Accepted

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

print(b)

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=[float(x) for x in input().split()]

v.sort()

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

print(t)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
from heapq import heappush, heappop
import math

n = int(input())
v = list(map(int, input().split()))
hq = []
for i in range(n):
    heappush(hq, v[i])
for i in range(n-1):
    b = heappop(hq)
    c = heappop(hq)
    heappush(hq, (b+c)/2)
print(sum(hq))

Submission status: Accepted

Solution code:
from heapq import *

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

h = []
for i in range(n):
    heappush(h, v[i])

for i in range(n-1):
    x, y = heappop(h), heappop(h)
    heappush(h, (x + y) / 2)

print(h[0])

Submission status: Accepted

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

V.sort()

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

print(pre)

Submission status: Accepted

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

v = sorted(v)

ans = v[0]

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