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

while len(v_list) > 1:
    v_list.sort(reverse=True)
    v = (v_list[-2] + v_list[-1]) / 2
    v_list[-2] = v
    v_list.pop()
print(v_list[0])

Submission status: Accepted

Solution code:
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))
N = int(input())
v = LI()

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


print(pre)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
l = list(map(int,input().split()))
temp = 0
l.sort()

for i in range(N-1):
  temp = (float(l[0])+float(l[1]))/2
  del l[:2]
  l.insert(1, temp)

print(temp)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
num=int(input())
array = list(map(int, input().strip().split()))
la=array.sort()

wa=0
for i in range(1,num):
    if i==1:
        wa=(array[i-1]+array[i])/2
    else:
        wa=(wa+array[i])/2
print(wa)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
v1=map(int,input().split())
v=list(v1)
#価値の低いものから順に平均をとっていけばよい
for i in range(n):
    for j in range(i+1,n):
        if v[i]>v[j]:
            a=v[i]
            v[i]=v[j]
            v[j]=a
for l in range(n-1):
    v2=[]
    a=(v[0]+v[1])/2
    v2.append(a)
    v2=v2+v[2:n]
    v=v2
print(v[0])

Submission status: Accepted

Solution code:
#Nは品物の数
#ｖはそれぞれの品物の価値
N = input()
v = list(map(int, input().split()))
#vを価値の低い順(昇順)に並び替える
v.sort()
#ans = 出力する最終的な値
ans = 0 
#popは（）の中身の数番目の値を削除する
ans=v.pop(0)

for V in v:
    ans = (ans +V)/2.0

print('{:.6g}'.format(ans))

Submission status: Accepted

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

res = v[0]

for x in v[1:]:
    res += x
    res /= 2

print(res)

Submission status: Accepted

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

V.sort()
x = V.pop(0)
for v in V:
  x = (x + v) / 2.0
print(x)

Submission status: Accepted

Solution code:
def solve():
    N = int(input())
    v = sorted(map(int, input().split()))
    
    while len(v) > 1:
        v.insert(0, (v.pop(0)+v.pop(0))/2.0)
        
    print(v.pop())
    
solve()

Submission status: Accepted

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

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

while True:
    v = sorted(v)
    if len(v) >= 2:
        a = (v[0] + v[1]) / 2
        v[1] = a
        v = v[1::]
    else:
        break
print(v[0])

Submission status: Accepted

Solution code:
N = int(input())

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

v_sort = sorted(v)
a=v_sort[0]

for n in range(N-1):
  a = (a+v_sort[n+1])/2
print(a)

Submission status: Accepted

Solution code:
import heapq

def solve(n, v):
    q = []
    for i in range(n):
        heapq.heappush(q, v[i])
    for i in range(n-1):
        x = heapq.heappop(q)
        y = heapq.heappop(q)
        heapq.heappush(q, (x+y)/2)
    return heapq.heappop(q)

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

Submission status: Accepted

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

while i < n and len(v) >= 2:
	v.sort()
	f = v.pop(0)
	s = v.pop(0)
	ans = (s+f)/2
	v.append(ans)
	i += 1

print(ans)

Submission status: Accepted

Solution code:
input()
s=list(map(int, input().split()))
s.sort()
res=0
for i in s:
  if res  == 0:
    res = i
    continue
  res=(res+i)/2
print(res)

Submission status: Accepted

Solution code:
import math
import copy
import sys


inputa = input().split()
# inputb = input().split()
# inputc = input().split()

a = int(inputa[0])
# b = int(inputa[1])
# c = int(inputa[2])

# x = int(inputb[0])
# y = int(inputb[1])

# inputaList = [int(n) for n in inputa]

inputb = input().split()
inputbList = [float(n) for n in inputb]
#
# inputList = []
# inputNumList = []
# for i in range(a):
#     inputNum = input()
#     inputNumList = list(inputNum)
#     inputList.append(inputNumList)

# inputList = [int(n) for n in inputList]

# b = [int(n) for n in inputb]
# c = [int(n) for n in inputc]

inputbList.sort()

tmpsum = 0

for i in range(1, a):
    if i == 1:
        tmpsum = (inputbList[0] + inputbList[1])/2
    else:
        tmpsum = (tmpsum + inputbList[i])/2

print(tmpsum)

Submission status: Accepted

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

v_list2 = sorted(v_list)

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

print(ans)

Submission status: Accepted

Solution code:
import heapq
N = int(input())
v_ls = [int(i) for i in input().split()]
heapq.heapify(v_ls)
while len(v_ls) > 1:
    smallest = heapq.heappop(v_ls)
    second = heapq.heappop(v_ls)
    heapq.heappush(v_ls, (smallest + second) / 2)
print(heapq.heappop(v_ls))

Submission status: Accepted

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

Submission status: Accepted

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

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

else:
	print(v[0])

Submission status: Accepted

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

v.sort()

while i < N - 1:
    v[i + 1] = (v[i] + v[i + 1]) / 2
    i += 1
    
print(v[i])

Submission status: Accepted

Solution code:
from functools import reduce
N = int(input())
li = sorted(list(map(int, input().split())))

ans = reduce(lambda x,y: (x+y)/2, li)
print(ans)

Submission status: Accepted

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

v.sort()

r = v[0]

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

print(r)

Submission status: Accepted

Solution code:
n = input()
values = list((input()).split(" "))

v = sorted(list(map(lambda x: int(x), values)))

result = v.pop(0)
while len(v) > 0 :
    el = v.pop(0)
    result = (result + el)/2
    
print(result)

Submission status: Accepted

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

sum = v_list[0] / (2 ** (N - 1))
for i in range(v_len - 1):
  sum += v_list[i+1] / (2 ** (N - 1 - i))
  
print(sum)

Submission status: Accepted

Solution code:
from collections import deque

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

nums = deque(sorted(nums))

A = nums.popleft()
while len(nums) != 0:
    A = (A + nums.popleft()) / 2

print(A)

Submission status: Accepted

Solution code:
from sys import exit, stdin
N = int(stdin.readline().rstrip())
V = sorted(int(_) for _ in stdin.readline().rstrip().split())
ans = 0
for i in range(1, N):
    if i == 1:
        ans = (V[i] + V[i-1]) / 2
    else:
        ans = (ans + V[i]) / 2
print(ans)

Submission status: Accepted

Solution code:
n =int(input())
arr=[int(x) for x in input().split()]
arr.sort()
ans = arr[0]

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
lst = list(map(int,input().split()))
lst.sort()
t = 0
t+=lst[0]/(2**(n-1))

for i in range(1,n):
    t+=lst[i]/(2**(n-i))
    
print(t)

Submission status: Accepted

Solution code:
from functools import reduce

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

V.sort()
v = reduce(lambda x, y: (x + y)/2.0, V)
print(v)

Submission status: Accepted

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

V.sort()

heapify(V)

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

ans = heappop(V)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())
b = list(map(int, input().split()))
result = 0

b.sort()

for i in range(a):
    if i == 0:
        result = b[i]
    else:
        result = result / 2
        result += b[i] / 2

print(result)

Submission status: Accepted

Solution code:
# -*- coding utf-8 -*-
import heapq
MOD = 10 ** 9 + 7

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

hq = []
for v in vn:
    heapq.heappush(hq, v)

for i in range(N - 1):
    x = heapq.heappop(hq)
    y = heapq.heappop(hq)
    heapq.heappush(hq, (x + y) / 2)

ans = hq[0]

print(ans)

Submission status: Accepted

Solution code:
N = int(input())
v = sorted(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())
L=list(map(int,input().split()))
L = sorted(L)
ans=L[0]
for a in L[1:]:
  ans = (ans+a)/2
print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8

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

v = sorted(v, reverse=True)

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

print(v[0])

Submission status: Accepted

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

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

print(b)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

for i in range(len(V) - 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()))
kati = 0

v.sort()
kati = (v[0] + v[1]) / 2

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

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

Submission status: Accepted

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

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

    Vs.sort()

    new_v = (Vs[0]+Vs[1])/2

    if N == 2:
        print(new_v)
        return

    for i in range(2, N):
        new_v = (new_v+Vs[i])/2

    print(new_v)


if __name__ == "__main__":
    solve()

Submission status: Accepted

Solution code:
N=int(input())
b=input().split(" ")
c=[]
for i in range (0,N):
    c.append(int(b[i]))
c.sort()
answer=c[0]
for i in range(1,N):
    answer=(answer+c[i])/2
print(answer)

Submission status: Accepted

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

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.sort()
sum = 0
sum = v[0] + v[1]
for i in range(1,n - 1):
    sum += v[i + 1] * (2**i)
print(sum / 2**(n - 1))

Submission status: Accepted

Solution code:
N = int(input())

x = list(map(int, input().split()))
x.sort()

y = x[0]
for i in x[1:]:
    y = (y + i) / 2
print(y)

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
from operator import itemgetter

def main():
	n = int(input().strip())
	v = list(map(int, input().strip().split()))
	v.sort()
	ans = v[0]
	for i in range(1, n):
		ans = (ans+v[i])/2
	print("{:.5f}".format(ans))


if __name__ == '__main__':
	main()

Submission status: Accepted

Solution code:
from decimal import *

input()
N = list(map(int, input().split()))
N.sort()
ans = 0
while True:
    try:
        tmpa = N.pop(0)
        ans = tmpa
        tmpb = N.pop(0)
        N.append((Decimal(tmpa)+Decimal(tmpb))/Decimal(2))
        N.sort()
    except IndexError:
        break
print(ans)

Submission status: Accepted

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

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



if __name__ == "__main__":
    main()

Submission status: Accepted

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

V.sort()

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

print(r)

Submission status: Accepted

Solution code:
N = input()
v = input().split(" ")
v_list = [int(i) for i in v]
v_list.sort()
temp = 0
for i in range(len(v_list)-1):
    tmep = (v_list[i] + v_list[i + 1]) / 2
    v_list[i + 1] = tmep

print(v_list[len(v_list)-1])

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
# Nの入力
n = int(input())
# スペース区切りの整数の入力
a = sorted(list(map(float, input().split())))
value = a[0]
#value = a.get(0)
for i, e in enumerate(a):
	if i > 0:
		value = (value + e)/2
print(value)

Submission status: Accepted

Solution code:
# -*- coding: UTF-8 -*-
# ABC138_C

import math

N = int(input())

inputV = input("")
arrayV = [int(n) for n in inputV.split()]
arrayV.sort(reverse=True)

value = 0
pow = 1
for i in arrayV:
    value = value + i * math.pow(2, -pow)
    pow = pow + 1

value = value + arrayV[N - 1] * math.pow(2, -N)

print(value)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

N = int(input())
V = list(map(int, input().split()))
hq = []
for v in V:
    heapq.heappush(hq, v)

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
A = sorted([int(arr) for arr in input().split()])
while len(A)>1:
    x = A.pop(0)
    y = A.pop(0)
    tmp = (x+y)/2
    A.append(tmp)
    A.sort()
print(A[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
total_num = int(input())
materials = input().split()

for key,value in enumerate(materials):
  materials[key] = int(value)

materials.sort()
total_value = (materials[0] + materials[1]) / 2

# 最初の2つを除去する
materials.pop(0)
materials.pop(0)

for index,value in enumerate(materials):
  if(index + 1 <= total_num - 2):
    total_value = (total_value + materials[index]) / 2
  else:
    break;

print(total_value)

Submission status: Accepted

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

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

print(V[0])

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import glob

IS_TEST = False

# 問題ごとのディレクトリのトップからの相対パス
REL_PATH = 'ABC\\138\\C'

# テスト用ファイル置き場のトップ
TOP_PATH = 'C:\\AtCoder'


class Common:

    problem = []
    index = 0

    def __init__(self, rel_path):
        self.rel_path = rel_path

    def initialize(self, path):
        file = open(path)
        self.problem = file.readlines()
        self.index = 0
        return

    def input_data(self):
        if IS_TEST:
            self.index += 1
            return self.problem[self.index-1]

        else:
            return input()

    def resolve(self):
        pass

    def exec_resolve(self):
        if IS_TEST:
            for path in glob.glob(TOP_PATH + '\\' + self.rel_path + '/*.txt'):
                print("Test: " + path)
                self.initialize(path)
                self.resolve()
                print("\n\n")
        else:
            self.resolve()


class C(Common):

    def resolve(self):
        item_num = int(self.input_data())
        items = [int(i) for i in self.input_data().split()]

        items.sort()
        result = items[0]

        for value in items:
            result = (result + value) / 2

        print(str(result))


solver = C(REL_PATH)
solver.exec_resolve()

Submission status: Accepted

Solution code:
n=int(input())
v=[int(e) for e in input().split()]
v.sort()
a=float(v[0])
for i in range(0,n-1):
  a=(a+v[i+1])/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 = sorted([int(i) for i in input().split(' ')])

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = [int(x) for x 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
from operator import itemgetter #sortedの対象を決めたい
from fractions import gcd #最大公約数求めたい
from math import ceil, floor, sqrt #小数点切り上げ、切り捨て、平方根求めたい
from copy import deepcopy #参照で影響されないコピーが作られる
from collections import Counter, deque #要素ごとの出現回数を数える。双方向アクセス可能データ型
import heapq
from functools import reduce
sys.setrecursionlimit(200000)

input = sys.stdin.readline
# template


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())
vlist = list(map(int,input().split()))
vlist.sort()
before = vlist[0]
for i in range(1,N):
    before = (before+vlist[i])/2

print(before)

Submission status: Accepted

Solution code:
N=int(input())

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

v=sorted(v)

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

print(v[0])

Submission status: Accepted

Solution code:
N = int(input())
A = [int(s) for s in input().split()]
A.sort()
a = 0
for i in range(N-1):
    a = (A[0] +A[1])/2
    A[0] = a
    A.remove(A[1])
print(A[0])

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.sort()
b = a[0]
for i in range(1, len(a)):
    b = (b + a[i]) / 2
print(b)

Submission status: Accepted

Solution code:
# 整数の数の入力
N = int(input())

# 数列の入力
A = list(map(int, input().split()))

# 数列長が2の場合
# 2つの要素の和を2で割った値を出力
if N == 2:
	print(sum(A) / 2)

# 数列長が2以外の場合
# 数列をソートし小さい値2つを合成対象にする
else:
	while len(A) != 2:
		A.sort()
		A = [(A[0] + A[1]) / 2] + A[2:]
	print(sum(A) / 2)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

current = a[0]

for x in range(1,n):
    current = (current + a[x])/2
print(current)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
for i in range(N):
    S[i] = float(S[i])
S.sort()
for i in range(N-1):
    S[i+1] = (float(S[i])+float(S[i+1])) / 2
print(S[N-1])

Submission status: Accepted

Solution code:

N = int(input())
#s = input()
#S = []
#for i in range(N):
S = input().split(" ")
for i in range(N):
    S[i] = float(S[i])
S.sort()
for i in range(N-1):
    S[i+1] = (float(S[i])+float(S[i+1])) / 2.000000
print(S[N-1])

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
V.sort() # 小さい順に

mean = 0
for i in range(len(V)):
    mean += V[i]/2.**(len(V)-i)
print(mean + V[0]/2.**len(V))

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
print(sum([x/2 ** i for i, x in enumerate(reversed(sorted(v)), 1)]) + min(v)/2**n)

Submission status: Accepted

Solution code:
from functools import reduce
n=int(input())
p=list(map(int,input().split()))
p.sort()
s=reduce(lambda a,b:(a+b)/2,p)
print(s)

Submission status: Accepted

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

a = sorted(a, reverse=True)
sm = 0
a[len(a)-2] += a[len(a)-1]
for i in range(len(a)-1):
    sm += a[i]/2**(i+1)
print(sm)

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

Submission status: Accepted

Solution code:
n = int(input())
a = [int(x) for x in input().split()]
a.sort()
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()
for i in range(N-1):
    v[i+1] = (v[i] + v[i+1]) / 2
print(v[N-1])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# -*- encoding=utf-8 -*-
N = int(input())
v = list(map(int,input().split(' ')))

while(len(v) != 1):
  v.sort()
  a = v.pop(0)
  b = v.pop(0)
  v.append((a+b)/2)
print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
arr = list(map(int,input().split()))
arr.sort()
 
ans = arr[0]
for i in range(1,n):
    ans = (ans+arr[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(N-1):
    a = (a +V[1])/2
    del V[0]
print(a)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def calc(vlist):
    sum = vlist[0]
    for i in range(len(vlist) - 1):
        sum = ((sum + vlist[i+1]) / 2)

    return sum
   
try:
    n = int(input())

    v = [int(x) for x in input().split(' ')]
    v.sort()
    
    print(calc(v))
    
except ValueError:
    print("数値を入力してください")

Submission status: Accepted

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

v.sort()

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

# 合成すると総価値が下がるので、価値の低いものから使っていくとダメージが少ないはず。。。
# N<50なので愚直にやっていいはず
v_list.sort()

s = v_list.pop(0)

for v in v_list :
    s = (s + v) / 2.0

print(s)

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

while len(sv)>=2:
    a=sv.pop(0)
    b=sv.pop(0)
    new =(a+b)/2
    sv.append(new)
    sv.sort()

print(sv[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

for i in range(n-1):
	v.sort(reverse=1)
	a = v.pop()
	b = v.pop()
	ab = (a+b)/2
	v.append(ab)
print(v[0])

Submission status: Accepted

Solution code:
from decimal import Decimal

# Get input
n = int(input())
a = [Decimal(c) for c in input().split()]
a.sort()

current_value = a[0]
for i in range(1, len(a)): current_value = (current_value + a[i]) / 2;
print(current_value)

Submission status: Accepted

Solution code:
n,arr = int(input()),list(map(int,input().split(' ')))
stack = []
arr = sorted(arr)
stack.append(arr[0])
arr.pop(0)
while arr:
    stack.append((stack[-1] + arr[0])/2)
    arr.pop(0)
print(stack[-1])

Submission status: Accepted

Solution code:
n=int(input())
l=list(map(int,input().split()))
l.sort()
x=(l[0]+l[1])/2
t=2
while(t<n):
    x=(x+l[t])/2
    t+=1
print(x)

Submission status: Accepted

Solution code:
N = int(input())
V = sorted([int(_) for _ in input().split()])
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()))

value = 0
listed_v = sorted(v)
for i in range(N):
    if len(listed_v) > 1:
        value = (listed_v[0] + listed_v[1])/2
        listed_v = [(listed_v[0] + listed_v[1])/2] +  listed_v[2:]
print(value)