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:
# template by 3xC and starkizard.
# contributors: 

#####################################################################################
from __future__ import division, print_function 

import sys
import os
from collections import Counter, deque, defaultdict
import itertools
import math
import io


"""Uncomment modules according to your need"""


# from bisect import bisect_left, bisect_right, insort
# from heapq import heappop, heapify, heappush
# from random import randint as rn
# from Queue import Queue as Q
# from copy import deepcopy
# from decimal import *
# import re
# import operator

#####################################################################################
# this enables you to write python3 code with PyPy2 (Python 2)
if sys.version_info[0] < 3:
    input = raw_input
    range = xrange

    filter = itertools.ifilter
    map = itertools.imap
    zip = itertools.izip

#####################################################################################

"""value of mod"""
MOD = 998244353
mod = 10**9 + 7

"""Uncomment next 4 lines if doing huge recursion"""
# import threading
# threading.stack_size(1<<27)
# sys.setrecursionlimit(10000

def prepare_factorial(mod=mod):
    """ returns two lists, factorial and inverse factorial modulo argument by default 10**9 +7 """
    # Comment code out when you don't need inverse factorial or vice versa
    fact = [1]
    for i in range(1, 200005):
        fact.append((fact[-1] * i) % mod)

    ifact = [0] * 200005
    ifact[200004] = pow(fact[200004], mod - 2, mod)
    for i in range(200004, 0, -1):
        ifact[i - 1] = (i * ifact[i]) % mod

    return fact, ifact

def modinv(n, p):
    """ returns N inverse modulo p """
    return pow(n, p - 2, p)

def ncr(n, r,  fact, ifact):
    """ takes 4 arguments: n , r and factorial and inverse factorial lists"""
    t = (fact[n] * (ifact[r]*ifact[n-r]) % MOD)% MOD
    return t


def get_n(Sum):    
    """this function returns the maximum n for which Summation(n) <= Sum"""
    ans = (-1 + sqrt(1 + 8*Sum))//2
    return ans

def sieve(n):
    """ returns a list of prime numbers till n """
    if n < 2: return list()
    prime = [True for _ in range(n + 1)]
    p = 3
    while p * p <= n:
        if prime[p]:
            for i in range(p * 2, n + 1, p):
                prime[i] = False
        p += 2
    r = [2]
    for p in range(3, n + 1, 2):
        if prime[p]:
            r.append(p)
    return r



def divs(n, start=1):
    """ returns a list of all divisors till n """
    divisors = []
    for i in range(start, int(math.sqrt(n) + 1)):
        if n % i == 0:
            if n / i == i:
                divisors.append(i)
            else:
                divisors.extend([i, n // i])
    return divisors



def divn(n, primes):
    """ returns the number of divisors, two arguments n and the sieve till n """
    divs_number = 1
    for i in primes:
        if n == 1:
            return divs_number
        t = 1
        while n % i == 0:
            t += 1
            n //= i
        divs_number *= t



def lrfind(d, x, default=-1):
    """ Takes 2 arguments an iterable and an element. returns a tuple (firstoccurence,lastoccurence) -1 if not found """
    left = right = -1
    for i in range(len(d)):
        if d[i] == x:
            if left == -1: left = i
            right = i
    if left == -1:
        return default, default
    else:
        return left, right

def gcd(x, y): # math.gcd is slower
    """ returns greatest common divisor of x and y """
    while y:
        x, y = y, x % y
    return x

def check_sorted(a):
    ''' returns True/False '''
    for i in range(len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
def ceil(n, k=1): return n // k + (n % k != 0) #returns math.ceil but protecting against floating inconsistencies
def input(): return sys.stdin.readline().strip()
def ii(): return int(input()) #inputs integer
def mi(): return map(int, input().split()) # inputting space seperated variables for example x,y,z
def li(): return list(map(int, input().split())) #inputting a space seperated list of integers
def lw(): return input().split() #inputting a space seperated list of strings
def lcm(a, b): return abs(a * b) // gcd(a, b) #returns LCM of two arguments
def prr(a, sep=' ', end='\n'): print(sep.join(map(str, a)), end=end) #For printing an iterable with seperator sep as optional second argument (default : " "), ending character (default: "\n") as optional third
def dd(): return defaultdict(int) #returns a dictionary with values defaulted to 0
def ddl(): return defaultdict(list) #returns a dictionary with values defaulted to []
def write(s): return sys.stdout.write(s)












###################################################################
def main():
    #CODE GOES HERE:
    n=ii()
    v=li()
    v.sort()
    answer=v[0]
    for i in range(1,n):
        answer+=v[i]
        answer/=2
    print(answer)





















    
""" -------- Python 2 and 3 footer by Pajenegod and c1729 ---------"""

py2 = round(0.5)
if py2:
    from future_builtins import ascii, filter, hex, map, oct, zip
    range = xrange

import os, sys
from io import IOBase, BytesIO

BUFSIZE = 8192

class FastIO(BytesIO):
    newlines = 0

    def __init__(self, file):
        self._file = file
        self._fd = file.fileno()
        self.writable = "x" in file.mode or "w" in file.mode
        self.write = super(FastIO, self).write if self.writable else None

    def _fill(self):
        s = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
        self.seek((self.tell(), self.seek(0, 2), super(FastIO, self).write(s))[0])
        return s

    def read(self):
        while self._fill(): pass
        return super(FastIO, self).read()

    def readline(self):
        while self.newlines == 0:
            s = self._fill();
            self.newlines = s.count(b"\n") + (not s)
        self.newlines -= 1
        return super(FastIO, self).readline()

    def flush(self):
        if self.writable:
            os.write(self._fd, self.getvalue())
            self.truncate(0), self.seek(0)


class IOWrapper(IOBase):

    def __init__(self, file):
        self.buffer = FastIO(file)
        self.flush = self.buffer.flush
        self.writable = self.buffer.writable
        if py2:
            self.write = self.buffer.write
            self.read = self.buffer.read
            self.readline = self.buffer.readline
        else:
            self.write = lambda s: self.buffer.write(s.encode('ascii'))
            self.read = lambda: self.buffer.read().decode('ascii')
            self.readline = lambda: self.buffer.readline().decode('ascii')


sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
input = lambda: sys.stdin.readline().rstrip('\r\n')
# sys.stdin = open('input.txt', 'r')
# sys.stdout = open('output.txt', 'w')

""" main function"""

if __name__ == '__main__':
    main()
    # threading.Thread(target=main).start()

Submission status: Accepted

Solution code:
n=int(input())
v=list(map(int,input().split()))
ans=0.0
temp=0
for _ in range(n):
    for i in range(n-1):
        if v[i]>v[i+1]:
            temp=v[i]
            v[i]=v[i+1]
            v[i+1]=temp

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq
n = int(input())

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

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

Submission status: Accepted

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

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

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def actual(N, V):
    # 降順にソートして最後尾の小さい値から合成していく
    V.sort(reverse=True)

    while len(V) != 1:
        first_small = V.pop()
        second_small = V.pop()

        new_value = (first_small + second_small) / 2

        V.append(new_value)

    return V[0]

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

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
# -*- coding: utf-8 -*-
import sys
# sys.setrecursionlimit(10**6)
# buff_readline = sys.stdin.buffer.readline
buff_readline = sys.stdin.readline
readline = sys.stdin.readline

INF = 2**62-1


def read_int():
    return int(buff_readline())


def read_int_n():
    return list(map(int, buff_readline().split()))


def read_float():
    return float(buff_readline())


def read_float_n():
    return list(map(float, buff_readline().split()))


def read_str():
    return readline().strip()


def read_str_n():
    return readline().strip().split()


def error_print(*args):
    print(*args, file=sys.stderr)


def mt(f):
    import time

    def wrap(*args, **kwargs):
        s = time.time()
        ret = f(*args, **kwargs)
        e = time.time()

        error_print(e - s, 'sec')
        return ret

    return wrap


class Mod:
    def __init__(self, m):
        self.m = m

    def add(self, a, b):
        return (a + b) % self.m

    def sub(self, a, b):
        return (a - b) % self.m

    def mul(self, a, b):
        return ((a % self.m) * (b % self.m)) % self.m

    def div(self, a, b):
        return self.mul(a, pow(b, self.m-2, self.m))

    def pow(self, a, b):
        return pow(a, b, self.m)


@mt
def slv(N, V):
    V.sort(reverse=True)
    from fractions import Fraction
    while len(V) > 1:
        a = V.pop()
        b = V.pop()
        V.append(Fraction(a+b, 2))
    return float(V[0])





def main():
    N = read_int()
    V = read_int_n()
    print(slv(N, V))


if __name__ == '__main__':
    main()

Submission status: Accepted

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

V.sort()
now=V[0]

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

Submission status: Accepted

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

vlist.sort()

sum=0
for i,v in enumerate(vlist):
    if i == 0:
        sum += v
    else:
        sum += (2**(i-1)) * v
print(sum / (2**(n-1)))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
from math import pi, cos, sqrt
from collections import defaultdict
readline = sys.stdin.buffer.readline
#sys.setrecursionlimit(10**8)


def geta(fn=lambda s: s.decode()):
    return map(fn, readline().split())


def gete(fn=lambda s: s.decode()):
    return fn(readline().rstrip())


def main():
    N = gete(int)
    v = list(geta(int))
    v.sort()

    base = 1

    ans = v[0]
    for vi in v[1:]:
        ans += vi * base
        base *= 2

    print(ans / base)


if __name__ == "__main__":
    main()

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

while len(A) > 1:
    A.sort()
    x, y = A.pop(0), A.pop(0)
    v = (x + y) / 2
    A.append(v)

print(*A)

Submission status: Accepted

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

def mergesort(a):
    def _merge_sort(a, left: int, right: int):
        if left < right:
            center = (left+right)//2

            _merge_sort(a,left,center)
            _merge_sort(a,center+1,right)

            #pは前半部をbuffにコピーする際のインデックス、jで取り出す
            p=j=0
            i=k=left

            #配列の前半部をbuffにコピー
            while i <= center:
                buff[p]=a[i]
                p+=1
                i+=1

            #後半部をコピーされた前半部と比較、小さい方をaに格納していく
            while i<= right and j < p:
                if buff[j] <= a[i]:
                    a[k]=buff[j]
                    j+=1
                else:
                    a[k]=a[i]
                    i+=1
                k+=1

            while j < p:
                a[k] =buff[j]
                k+=1
                j+=1

    n=len(a)
    #merge結果を一時的に格納
    buff=[None]*n
    _merge_sort(a,0,n-1)
    del buff

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

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

print(total)

Submission status: Accepted

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

v = sorted(v, reverse=True)
ans = 0

for i in range(n-1):
    time = 2 ** (i+1)
    ans += v[i] / time

ans += v[n-1] / time

print(ans)

Submission status: Accepted

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

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:
#なるべく小さいものから合成した方が良い
from functools import reduce
n = int(input())
v = sorted(list(map(int, input().split())))
def flat(x,y):
    return (x+y)/2
print(reduce(flat, v))

Submission status: Accepted

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

v.sort(reverse=True)

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

ans+=v[N-1]/(2**(i+1))

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

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

print(vn[N-1])

Submission status: Accepted

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

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:
import bisect

def main():
    N = int(input())
    v = sorted(list(map(int, input().split())))
    while len(v) > 1:
        num1 = v.pop(0)
        num2 = v.pop(0)
        avg = (num1 + num2) / 2
        idx = bisect.bisect(v, avg)
        v.insert(idx, avg)
    print(v[0])
main()

Submission status: Accepted

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


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

print(v[0])

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
a.sort()
ans=0
x=a.pop(0)
y=a.pop(0)
ans=(x+y)/2
while(len(a)!=0):
    ans=(ans+a.pop(0))/2
print(ans)

Submission status: Accepted

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

ans = 0

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

print(ans)

Submission status: Accepted

Solution code:
import math
from collections import defaultdict
ml=lambda:map(int,input().split())
ll=lambda:list(map(int,input().split()))
ii=lambda:int(input())
ip=lambda:(input())

"""========main code==============="""
t=ii()
a=ll()
a.sort()
ans=a[0]
for i in range(1,t):
    ans=(ans+a[i])/2
print(ans)

Submission status: Accepted

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

## Library

import sys
from fractions import gcd
import math
from math import ceil,floor
import collections
from collections import Counter

## input

# n=int(input())
# A,B,C,D=map(int, input().split())
# string = input()
# yoko = list(map(int, input().split()))
# tate = [int(input()) for _ in range(N)]
# N, M = map(int,input().split()) 
#    P = [list(map(int,input().split())) for i in range(M)]


N = int(input())
V = list(map(int, 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 = sorted(v)

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

print(V[-1])

Submission status: Accepted

Solution code:
n = int(input())

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

nums.sort()
value = nums[0]
for i in range(1, n):
    value = (value + nums[i])/2

print(value)

Submission status: Accepted

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

Vs.sort()

#print(Vs)

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

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

print(initialGousei)

Submission status: Accepted

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

V = sorted(V)

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

Submission status: Accepted

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

v.sort()

#print(v)

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

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

Submission status: Accepted

Solution code:
def main() -> None:
    _ = int(input())
    V = [int(x) for x in input().split()]
    V.sort()
    ans = V[0]
    for v in V[1:]:
        ans = (v + ans) / 2
    print("{:.15f}".format(ans))


if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
#!/usr/bin/env python
from collections import deque, defaultdict
from itertools import combinations, combinations_with_replacement
import bisect
from math import factorial, sqrt, log, ceil, floor


def main():
    #N, M = map(int, input().split())
    #N, K = map(int, input().split())

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


    for i in range(N-1):
        Vs = sorted(Vs)
        two = sum(Vs[:2]) / 2
        Vs.pop(0)
        Vs.pop(0)
        Vs.append(two)

    print(two)


if __name__ == '__main__':
    main()

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: str(sys.stdin.buffer.readline().rstrip())
rs = lambda: map(str, sys.stdin.buffer.readline().split())
ri = lambda: int(sys.stdin.buffer.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.buffer.readline().split()))

n = ri()
a = rl()
def heapsort(l):
  li = []
  for v in l:
    heapq.heappush(li, v)
  return [heapq.heappop(li) for _ in range(len(li))]
a = heapsort(a)
ans = a[0]
for i in a:
  ans = (ans + i)/2
print(ans)

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
from functools import reduce

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

V = sorted(V)
ans = reduce(lambda x,y: (x+y)/2, V, V[0])

print(ans)

Submission status: Accepted

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

for i in range(1, n):
  x=float(sum(v[-2:])/2)
  #print(x)
  del v[-2:]
  v.append(x)

print(sum(v))

Submission status: Accepted

Solution code:
n=int(input())
v= list(map(int,input().split()))
c=[0]*(n)
v.sort()

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

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
n = int(input())
nums = list(map(float, 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)
vm = v[0]
for i in range(1, N):
    vm = (vm + v[i])*0.5
print(vm)

Submission status: Accepted

Solution code:
import heapq

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

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:
def resolve():
    N = int(input())
    v = list(map(int, input().split()))
    if len(v) == 1:
        print(v[0])
        return

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

    print(v[0])

resolve()

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:
import heapq
N = int(input())
A = [ i for i in list(map(int,input().split()))]
heapq.heapify(A)

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

print(heapq.heappop(A))

Submission status: Accepted

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

ans = vs[0]
for i in range(1, N):
    ans = (ans + vs[i]) * 0.5
print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int, input().split(' ')))
v.sort()
item1 = v.pop(0)
while v:
  item2 = v.pop(0)
  v.append((item1 + item2) / 2)
  v.sort()
  item1 = v.pop(0)
print(item1)

Submission status: Accepted

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

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

v.sort()
while True:
    if len(v) == 1:
        break
    v[0] = f(v[0],v[1])
    del v[1]
print(v[0])

Submission status: Accepted

Solution code:
import sys
from collections import deque
import bisect
input = lambda: sys.stdin.readline().rstrip()


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

    while len(v) > 1:
        v1 = v.pop(0)
        v2 = v.pop(0)
        nv = (v1 + v2) / 2
        if len(v) == 0:
            break
        else:
            i = bisect.bisect_left(v, nv)
            v.insert(i, nv)

    print(nv)


if __name__ == '__main__':
    solve()

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[-1])

Submission status: Accepted

Solution code:
def f(x, y):
  return (x + y) / 2

N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=False)

while True:
  if len(A) == 1:
    break
  A[0] = f(A[0], A[1])
  del A[1]

print(A[0])

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

Submission status: Accepted

Solution code:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

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

v.sort()

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

Submission status: Accepted

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

while(len(li)>1):
  li.sort()
  li.append((li[0]+li[1])/2)
  del li[0:2]
  
print(li[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:
from functools import reduce
def main():
    n = int(input())
    a = reduce(lambda x, y: (x+y)/2, sorted(map(int, input().split())))
    print(a)
    
if __name__ == "__main__":
    main()

Submission status: Accepted

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

while len(V) > 1:
    first = V.pop()
    second = V.pop()
    mixed = (first+second)/2
    V.append(mixed)

print(V[0])

Submission status: Accepted

Solution code:
n = int(input())

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

lis = sorted(lis)

if len(lis) == 2:
    print((lis[0]+lis[1])/2)
    exit()
else:
    ans = 0
    tmp = (lis[0]+lis[1])/2
    for i in range(2,n-1):
        tmp = (tmp + lis[i])/2
        
    ans = (tmp+lis[n-1])/2
    
print(ans)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
v = list(input().split())
v = list(sorted([int(v[i]) for i in range(N)]))
MAX = v[0]

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

print(MAX)

Submission status: Accepted

Solution code:
import heapq
n,heap = raw_input(), map(float, raw_input().split(' '))
heapq.heapify(heap)
while(len(heap)>1): heapq.heappush(heap,  (heapq.heappop(heap) + heapq.heappop(heap)) * 0.5)
print heap[0]

Submission status: Accepted

Solution code:
import heapq
n = raw_input()
heap = [x*(1) for x in map(float, raw_input().split(' '))]
heapq.heapify(heap)

while(len(heap)>1):
	u,v = heapq.heappop(heap), heapq.heappop(heap)
	w = 0.5*(u+v)
	heapq.heappush(heap, w)

print heap[0]

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:

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

v.sort()

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

#print(v)
print(v[N-1])

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

v_sorted = sorted(v)

ans = [0]*N

for i in range(N):
    if i==0:
        ans[i] = v_sorted[i]
        
    else:
        ans[i] = (ans[i-1] + v_sorted[i])/2
        
print(ans[-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 = (ans+v[i])/2
print(ans)

Submission status: Accepted

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

while True:
    if len(v_list_s) <= 1:
        break
    temp_c = (v_list_s[-1] + v_list_s[-2])/2
    v_list_s.remove(v_list_s[-1])
    v_list_s.remove(v_list_s[-1])
    v_list_s.append(temp_c)

print(sorted(v_list_s)[0])