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

v_sorted = sorted(v)

value = v_sorted[0]
for i, _ in enumerate(v_sorted[:-1]):
    value = (value + v_sorted[i + 1]) / 2

print(value)

Submission status: Accepted

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

V.sort()
print(sum([vi/(2**(N-i)) if i >=1 else vi/(2**(N-1)) for i,vi in enumerate(V)]))

Submission status: Accepted

Solution code:
import sys
from math import *
stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
vvv = na()
list.sort(vvv)
for i in range(n-1):
    m = (vvv[0]+vvv[1])/2
    vvv.append(m)
    vvv.pop(0)
    vvv.pop(0)
    list.sort(vvv)
print(vvv[0])

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

def f(v):
    if len(v) == 1:
        return v[0]
    return (f(v[:-1]) + v[-1]) / 2

print(f(v))

Submission status: Accepted

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

print(value)

Submission status: Accepted

Solution code:
n = int(input())
a = sorted(list(map(int, input().split())))
ans = 0
for i, num in enumerate(a):
  if i == 0:
    ans = num
  else:
    ans = (ans + num) / 2
print(ans)

Submission status: Accepted

Solution code:
n=int(input())
a=[int(x) for x in 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())
S = input().split()
S = [int(s_i) for s_i in S]

S.sort()
first = S.pop(0)
second = S.pop(0)
val = (first+second)/2
for d in S:
  val = (val+d)/2
  
print(val)

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

print(a)

Submission status: Accepted

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

while v:
    ans = (ans + v.pop(0)) / 2

print(ans)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

print(value)

Submission status: Accepted

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

Submission status: Accepted

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


def solve(N, v):
    v = list(sorted(v))
    a = v[0]
    for b in v[1:]:
        a = (a+b) / 2.0
    return a

if __name__ == '__main__':
    N = int(input())
    v = list(map(int, input().split()))

    ans = solve(N, v)

    print(ans)

Submission status: Accepted

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

v.sort()

mean = v[0]
for i in v:
  mean = (mean + i)/2

  
print(mean)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from functools import reduce
n = int(input())
v = list(map(int, input().split()))
v.sort()
r = reduce(lambda a, b : (a + b) / 2, v[1:], v[0])
print(r)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import heapq as hq

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

hq.heapify(v)

while len(v) > 1:
    v1 = hq.heappop(v)
    v2 = hq.heappop(v)
    hq.heappush(v, (v1+v2)/2)

print(hq.heappop(v))

Submission status: Accepted

Solution code:
tmp = int(input())
A = [int(i) for i in input().split()]
A.sort(reverse= True)
new_material = 0
for i in range(0,tmp-1):
    new_material = (A.pop() + A.pop())/2
    A.append(new_material)
print(A.pop())

Submission status: Accepted

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

print(V_result)

Submission status: Accepted

Solution code:
import sys

def input():
    return sys.stdin.readline().rstrip()

if __name__ == "__main__":
    n = int(input())
    vl = list(map(int, input().split()))

    vl.sort()

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

    print(ans)

Submission status: Accepted

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

minmin = sorted(V)

tmp = -1
for i in range(N):
    if i == 0:
        continue
    else:
        if tmp == -1:
            tmp = (minmin[i-1] + minmin[i])/2
        else:
            tmp = (tmp + minmin[i])/2
    # print(tmp)

print(tmp)

Submission status: Accepted

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

res = vv.pop(0)
while len(vv) > 0:
    res = (res + vv.pop(0)) / 2

print(res)

Submission status: Accepted

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

print(result)

Submission status: Accepted

Solution code:
import sys

N = int(sys.stdin.readline())
vlist = sorted(list(map(int, sys.stdin.readline().split())))

for i in range(0, N-1):
  newv = (vlist[0] + vlist[1])/2
  del vlist[:2]
  vlist = sorted([newv] + vlist)
  
print(vlist[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000)

def getN():
    return int(input())
def getList():
    return list(map(int, input().split()))
import math

n = getN()
nums = sorted(getList())

tmp = nums[0]
for num in nums[1:]:
    tmp = (tmp + num) / 2

print(tmp)

Submission status: Accepted

Solution code:
from heapq import *

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

while 1 < len(v_list):
    item = (heappop(v_list)+heappop(v_list))/2
    heappush(v_list, item)

print(v_list[0])

Submission status: Accepted

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

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

    while len(v_list) > 1:
        buf = sorted(v_list)
        v_list.remove(buf[0])
        v_list.remove(buf[1])
        v_list.append((buf[0] + buf[1]) / 2)

    print(v_list[0])

if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

vi = sorted(vi)
c = vi[0]/(2**(N-1))
for i in range(1,N):
  c = c + vi[i]/(2**(N-i))

print(c)

Submission status: Accepted

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

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

print(sum(v))

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

Submission status: Accepted

Solution code:
n = int(input())
vl = list(map(int, input().split()))
vl.sort(reverse=True)
while len(vl) > 1:
    a = vl.pop()
    b = vl.pop()
    vl.append((a + b) / 2)
print(vl.pop())

Submission status: Accepted

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

A.sort()
val = A[0]
for i in range(1,N):
    val = (val+A[i])/2.0
print(val)

Submission status: Accepted

Solution code:
n = int(input())
vL = list(map(int,input().split()))
vL_sort = sorted(vL)
vL_sum = (vL_sort[0] + vL_sort[1])/2
if n >= 2:
    for i in range(2,n):
        vL_sum = (vL_sum+vL_sort[i])/2
print(vL_sum)

Submission status: Accepted

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

is_first = True
sum = 0
for i in v:
    if is_first:
        sum += i
        is_first = False
    else:
        sum = (sum + i) / 2.0

print( sum)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(lambda x: int(x), 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 = [int(i) for i in input().split(" ")]
V.sort()
m = V[0]
for i in range(1,len(V)):
    m = (m + V[i])/2
print(m)

Submission status: Accepted

Solution code:
def C():
    N = int(input())
    values = list(map(int, input().split()))

    values = sorted(values, reverse=True)
    weights = [(1/2)**(i+1) for i in range(N-1)] + [(1/2)**(N-1)]

    total_value = sum([values[i]*weights[i] for i in range(N)])

    print(total_value)


if __name__ == '__main__':
    C()

Submission status: Accepted

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

Vs.sort()

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

print(Vs[-1])

Submission status: Accepted

Solution code:
from sys import stdin
n = int(input())
v = [int(x) for x in stdin.readline().rstrip().split()]

w = sorted(v)

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

print(w[n-1])

Submission status: Accepted

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

ini = arr[0] + arr[1]
ini = ini/2
for i in range(2,a):
    ini = (ini + arr[i])/2
    
print(ini)

Submission status: Accepted

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

Submission status: Accepted

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

tmp = 0
for idx,val in enumerate(v):
        if tmp == 0:
                tmp = (val + v[idx + 1]) / 2
        else:
                tmp = (tmp + v[idx + 1]) / 2
        
        if idx == len(v) - 2:
                print(tmp)
                exit()

Submission status: Accepted

Solution code:
n = int(input())
value = list(map(int, input().split()))
value.sort()
while len(value) > 2:
    a = value.pop(0)
    b = value.pop(0)
    value.insert(0, (a+b)/2)
print(sum(value)/2)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq

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

heapq.heapify(v)
a = heapq.heappop(v)
b = heapq.heappop(v)
tmp = (a+b) / 2
heapq.heappush(v, tmp)

while len(v) != 1:
    heapq.heapify(v)
    a = heapq.heappop(v)
    b = heapq.heappop(v)

    tmp = (a+b) / 2
    heapq.heappush(v, tmp)
print(v[-1])

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int,input().split()))
V = sorted(V)
l = []
while (True):
  V.append(sum(V[:2])/2)
  del V[:2]
  V = sorted(V)
  if (len(V) == 1):
    break
print(V[0])

Submission status: Accepted

Solution code:
N = int(input())
A = sorted([int(x) for x in input().split()])
#queue = deque(A)
while len(A) != 1:
  a = A.pop(A.index(min(A)))
  b = A.pop(A.index(min(A)))
  A.append((a+b)/2)
print(A[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
v=sorted(list(map(int,input().split())),reverse=False)
#print(v)
ave=v[0]
for i in range(n-1):
  ave=(ave+v[i+1])*0.5
print(ave)

Submission status: Accepted

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

v.sort()

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

print(ans)

Submission status: Accepted

Solution code:
# coding: utf-8
# Your code here!
n=int(input())
d=input().split(" ")
for i in range(n):
   d[i]=int(d[i])
s=sorted(d,reverse=False)
#print(s)
ans=0
for i in range(n):
    ans=ans+s[i]
    if not i==0:
        ans=ans/2
print(ans)

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

print(tmp)

Submission status: Accepted

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

v.sort()

tmp = 0
for i in v:
    if tmp == 0:
        tmp = i
    else:
        tmp = (tmp + i) / 2
print(tmp)

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
"""
Spyder Editor

This is a temporary script file.
"""
n = int(input())
v = list(map(int, input().split()))
v.sort()
sp = 0
d = (int(v[0]) + int(v[1])) / 2
for i in range(2, n):
    d = (d + int(v[i])) / 2
print(d)

Submission status: Accepted

Solution code:
def main():
  Nums = int(input())
  numbers = map(int,input().split())

  nums_ = sorted(numbers)
  
  val = (nums_[0]+nums_[1])/2.0
  if Nums==2:
    print(val)
    return

  for i in range(2,len(nums_)):
    if i == 0:
      val = (nums_[i]+nums_[i+1])/2.0
    else:
      val = (val + nums_[i])/2.0
  print(val)  
  return


if __name__ == "__main__":
  main()

Submission status: Accepted

Solution code:
from collections import deque

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

val = V.popleft()
for i in range(N - 1):
    val2 = V.popleft()
    val = (val + val2) / 2

print(val)

Submission status: Accepted

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

lastV = sortedV[-1]
c = 2
res = 0
for v in sortedV:
    res += v / c
    c *= 2
# 最初だけひきすぎなので
res += lastV / (c / 2)
print(res)

Submission status: Accepted

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

result = n_list.pop(0)
for x in n_list:
    result = (result + x)/2

print(result)

Submission status: Accepted

Solution code:
N = int(input())
V = list(map(int, input().split()))
max_value = 0
for i in range(N-1):

    temp = min(V)
    V.remove(temp)
    temp2 = min(V)
    V.remove(temp2)

    V.append((temp+temp2)/2)

print(V[0])

Submission status: Accepted

Solution code:
import random
import math
import collections
import itertools
import functools
import operator
import os
import sys

ri = lambda: map(int, raw_input().split())
def pi(a): print (' '.join(map(str, a)))

n, a = input(), ri()
print reduce(lambda a, b : (a + b) / 2.0, sorted(a))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import numpy as np

N=int(input())
V=np.sort(np.array(input().split(),dtype=np.float))

for i in range(1,N):
    V[i]=(V[i-1]+V[i])/2.0

print(np.max(V))

Submission status: Accepted

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

Submission status: Accepted

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

lis = sorted(lis)

aveSum = lis[0]
for i in range(1, n):
    aveSum += lis[i]
    ave = aveSum / 2
    aveSum = ave

print(ave)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int, input().split()))
v.sort()
i=0
while not(len(v)==1):
    v_new = (v[0] + v[1]) / 2
    v.pop(0)
    v.pop(0)
    v.append(v_new)
    v.sort()
print(v[0])

Submission status: Accepted

Solution code:
num = int(input())
nums = [int(s) for s in input().split()]
nums.sort()
for i in range(num - 1):
  p = (nums[0] + nums[1]) / 2
  nums[0] = p
  del nums[1]
print(nums[0])

Submission status: Accepted

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

if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
import sys
def main():
    input = sys.stdin.readline
    n = int(input())
    Vs = list(map(int, input().split()))
    #print(Vs)
    Vs_sorted = sorted(Vs)

    for i in range(n):
        #print(Vs_sorted)
        x = Vs_sorted[0]
        y = Vs_sorted[1]
        z = (x + y) / 2
        Vs_sorted.pop(0)
        Vs_sorted.pop(0)
        Vs_sorted.append(z)
        Vs_sorted.sort()
        if len(Vs_sorted) == 1:
          break

    print(Vs_sorted[0])
 
if __name__ == '__main__':
    main()

Submission status: Accepted

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

Submission status: Accepted

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

vs.sort()

while len(vs) > 1:
	a = vs.pop(0)
	b = vs.pop(0)
	c = (a + b) / 2
	vs.insert(bisect.bisect_left(vs, c), c)

print(vs[0])

Submission status: Accepted

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

V = sorted(V)

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

print(ans)

Submission status: Accepted

Solution code:
n = int(input())

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

sum = 0
for i in range(len(v)):
    if i == len(v) - 1:
        sum += v[i] / 2**i
    else:
        sum += v[i] / 2**(i + 1)
        # print(v[i], sum)

print(sum)

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

Submission status: Accepted

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

from heapq import *

heapify(l)

for i in range(n-1):
    tmp1 = heappop(l)
    tmp2 = heappop(l)
    heappush(l, (tmp1+tmp2)/2)
print(l[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
a = int(input())

nums = input().split()

for num in range(a):
  nums[num] = int(nums[num])

nums.sort()

result = int(nums[0])
for num in range(1,a):
  result = (result + int(nums[num]))/2

print(result)

Submission status: Accepted

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

r_v_list = sorted(v_list)

total = 0

for i, v in enumerate(r_v_list[1:]):
    if i == 0:
        total = (r_v_list[0] + v) / 2
    else:
        total = (total + v) / 2

print(total)

Submission status: Accepted

Solution code:
def p_c():
    N = int(input())
    V = list(map(int, input().split()))
    ans = 0

    for _ in range(N - 1):
        V.sort()
        ans = (V.pop(0) + V.pop(0)) / 2
        V.append(ans)

    print(ans)


if __name__ == '__main__':
    p_c()

Submission status: Accepted

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

sozai = sorted(sozai)

ans = 0
for i, value in enumerate(sozai):
  if i >= 2:
    ans = (ans + value) / 2    
  else:
    ans = (sozai[0] + sozai[1]) / 2

print(ans)

Submission status: Accepted

Solution code:
# your code goes here
n=int(input())
l=[int(x) for x in input().split()]
l.sort()
# print(l)
ans=(l[0]+l[1])/2
for i in range(2,n):
	ans=(ans+l[i])/2
	# print(ans)
print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

while len(l) > 2:
    l = sorted(l, reverse=True)
    a = l.pop()
    b = l.pop()
    l.append((a+b)/2)

print((l[0]+l[1])/2)

Submission status: Accepted

Solution code:
import decimal
import heapq


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

heapq.heapify(vs)

# print(vs)
while len(vs) != 1:
    v1 = heapq.heappop(vs)
    v2 = heapq.heappop(vs)
    v = decimal.Decimal(v1) + decimal.Decimal(v2)
    v = v / decimal.Decimal(2)
    
    heapq.heappush(vs, v)

print(vs[0])

Submission status: Accepted

Solution code:
N = int(input()) # 数字を変数に格納
List = list(map(int,input().split())) # 複数の数字をリストに格納

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

Submission status: Accepted

Solution code:
n = int(input())
v = list(map(int,input().split()))
while len(v) > 1:
  x = min(v)
  v.remove(x)
  y = min(v)
  v.remove(y)
  v.append((x+y)/2)
print(v[0])

Submission status: Accepted

Solution code:
# coding: utf-8
n = int(input())
v_list = list(map(int, input().split()))

v_list.sort()

ans = v_list[0]

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

print(ans)

Submission status: Accepted

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

V.sort()

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

print(V[0])

Submission status: Accepted

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

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

v = sorted(v)

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

print(x)

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

Submission status: Accepted

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

sum = 0
for i, a in enumerate(an):
  sum += a / (2 ** (n-i))
sum += an[0] / (2 ** n)
print(sum)

Submission status: Accepted

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

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

print(res)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n = int(input())
l = sorted(map(int, input().split()), reverse = True)
c = l.pop()
for i in range(n-1):
    c = (c+ l.pop())/2

print(c)

Submission status: Accepted

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

nums.sort(reverse=True)

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

print((nums[0]+nums[1])/2)

Submission status: Accepted

Solution code:
import heapq

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

pq = []
for val in a:
    heapq.heappush(pq, val)

while len(pq) > 1:
    val1 = heapq.heappop(pq)
    val2 = heapq.heappop(pq)
    heapq.heappush(pq, (val1 + val2) / 2)

print(heapq.heappop(pq))

Submission status: Accepted

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

a = sorted(a)
ans = a[0]
for i in a[1:]:
    ans = (ans+i)/2

print(ans)

Submission status: Accepted

Solution code:
#
# Yet I'm feeling like
# 	There is no better place than right by your side
# 		I had a little taste
# 			And I'll only spoil the party anyway
# 				'Cause all the girls are looking fine
# 					But you're the only one on my mind


import sys
import re
# inf = float("inf")
#sys.setrecursionlimit(1000000)

# abc='abcdefghijklmnopqrstuvwxyz'
# abd={'a': 0, 'b': 1, 'c': 2, 'd': 3, 'e': 4, 'f': 5, 'g': 6, 'h': 7, 'i': 8, 'j': 9, 'k': 10, 'l': 11, 'm': 12, 'n': 13, 'o': 14, 'p': 15, 'q': 16, 'r': 17, 's': 18, 't': 19, 'u': 20, 'v': 21, 'w': 22, 'x': 23, 'y': 24, 'z': 25}
# mod,MOD=1000000007,998244353
# vow=['a','e','i','o','u']
# dx,dy=[-1,1,0,0],[0,0,1,-1]

# from cmath import sqrt
# from collections import deque, Counter, OrderedDict,defaultdict
from heapq import nsmallest, nlargest, heapify,heappop ,heappush, heapreplace
# from math import ceil,floor,log,sqrt,factorial,pow,pi,gcd,log10,atan,tan
# from bisect import bisect_left,bisect_right
# import numpy as np

def get_array(): return list(map(int , sys.stdin.readline().strip().split()))
def get_ints(): return map(int, sys.stdin.readline().strip().split())
def input(): return sys.stdin.readline().strip()

n=int(input())
Arr=get_array()
heapify(Arr)
while len(Arr)>1:
    x=heappop(Arr)
    y=heappop(Arr)
    z=(x+y)/2
    heappush(Arr,z)
print(Arr[-1])

Submission status: Accepted

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

maximum = v[-1]
v.remove(maximum)
while len(v)!=1:
    tmp = (v[0]+v[1])/2
    v.remove(v[1])
    v.remove(v[0])
    v.insert(0, tmp)

print((maximum + v[0])/2)

Submission status: Accepted

Solution code:
import heapq
def main():
    n = int(input())
    ls = [int(x) for x in input().split()]
    ls = sorted(ls)
    while 1:
        if len(ls)==1:
            break
        now1 = heapq.heappop(ls)
        now2 = heapq.heappop(ls)
        heapq.heappush(ls,(now1+now2)/2)
    print(ls[0])

if __name__ =="__main__":
    main()

Submission status: Accepted

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

vs.sort(reverse=True) # 降順

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

print(sum(v * f for v, f in zip(vs, factor)))

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
import sys
from functools import reduce
input = sys.stdin.readline


def main():
    N = int(input())
    v = list(map(int, input().split()))
    v.sort()
    ans = reduce(lambda a, b: (a+b) / 2, v)

    print(ans)


if __name__ == "__main__":
    main()

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)