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


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instr = lambda: sys.stdin.readline()
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

n = inint()
V = inintl()

V = sorted(V)

now = 0

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

print(now)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
n=int(input())
a=[int(i) for i in input().split()]
a=sorted(a)
while(len(a)>1):
    d=(a[0]+a[1])/2
    a[0]=d
    a.pop(1)
    if(len(a)==1):
        break
print(a[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  V = list(map(int, input().split()))
  V.sort(reverse=True)
  for _ in range(N-1):
    V[-2] = (V[-1]+V[-2])/2
    V.pop(-1)
  ans = sum(V)
  return ans
print(solve())

Submission status: Accepted

Solution code:
def solve():
  N = int(input())
  V = list(map(int, input().split()))
  ans = 0
  V.sort(reverse=True)
  for i in range(N-1):
    ans += V[i]/pow(2,i+1)
  ans += V[-1]/pow(2,N-1)
  return ans
print(solve())

Submission status: Accepted

Solution code:
N = int(input())
V = sorted(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())
A = list(map(int,input().split()))
A.sort()

for i in range(N-1):
  A_ave = (A[0] + A[1])/2
  del A[:2]
  A.append(A_ave)
  A.sort()
  
print(A[0])

Submission status: Accepted

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

t = 0
num = 0
v.sort()
for i in range(n):
    if i == 0:
        num += v[0]
    else:
        t = v[i]
        num = (num+t)/2

print(num)

Submission status: Accepted

Solution code:
#https://atcoder.jp/contests/abc078/tasks/abc078_c
N = int(input())
N_List = sorted(list(map(int,input().split())))
for i in range(N-1):
    Current_N = (N_List[0]+N_List[1])/2
    del N_List[0:2]
    N_List.insert(0,Current_N)

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

v.sort()
ans = 0

for i in range(N - 1):
    v1 = v.pop(0)
    v2 = v.pop(0)
    vv = (v1 + v2) / 2
    v.insert(0, vv)
print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:

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

X.sort()
ans = X[0] + X[1]
for i in range(2, N):
    ans += X[i] * 2 ** (i - 1)

print(ans / 2 ** (N - 1))

Submission status: Accepted

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

while len(v) > 1:
    v.sort()
    t1 = v.pop(0)
    t2 = v.pop(0)

    v.append((t1 + t2) / 2)

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from decimal import *

N, *V = map(Decimal, open(0).read().split())
V.sort(reverse=True)

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

Submission status: Accepted

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

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

print(tmp)

Submission status: Accepted

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

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

print(a)

Submission status: Accepted

Solution code:
from functools import reduce
N = int(input())
v = sorted([int(i) for i in input().split()])
print(reduce(lambda a, b:(a+b)/2, v))

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:
# -*- coding: utf-8 -*-
from functools import reduce

def mean_material(a, b):
    return (a+b)/2

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

print(reduce(mean_material, l_v))

Submission status: Accepted

Solution code:
N = int(input())
li = list(map(int, input().split()))
li.sort()
an = (li[0] + li[1])/2
for i in range(2,N):
    an = (an+li[i])/2
if an.is_integer():
 print(int(an))
else:
    print(an)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
import numpy as np
n = int(input())
V = list(map(float, input().split()))

V = np.array(sorted(V))
for i in range(1, n):
  V[:i+1] = V[:i+1] /2
print(np.sum(V))

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N=int(input())
A=list(map(int,input().split()))
A.sort()
for _ in range(N-1):
    t=(A.pop(0)+A.pop(0))/2
    A.insert(0,t)
print(*A)

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
# abc138_c.py
# https://atcoder.jp/contests/abc138/tasks/abc138_c

# C - Alchemist /
# 実行時間制限: 2 sec / メモリ制限: 1024 MB
# 配点 : 300点

# 問題文
# あなたは鍋と N個の具材を持っています。各具材は 価値 と呼ばれる実数の値を持ち、i 個目 (1≤i≤N) の具材の価値は viです。
# 2個の具材を鍋に入れると、それらは消滅して新たに 1 個の具材が生成されます。
# この新たな具材の価値は元の 2 個の具材の価値を x,y として (x+y)/2であり、この具材を再び鍋に入れることもできます。
# この具材の合成を N−1回行うと、最後に 1個の具材が残ります。この具材の価値として考えられる最大の値を求めてください。

# 制約
#     2≤N≤50
#     1≤vi≤1000
#     入力中の値はすべて整数である。

# 入力
# 入力は以下の形式で標準入力から与えられる。
# N
# v1 v2 … vN

# 出力
# 最後に残る 1個の具材の価値として考えられる最大の値を表す小数 (または整数) を出力せよ。
# 出力は、ジャッジの出力との絶対誤差または相対誤差が 10−5以下のとき正解と判定される。

# 入力例 1
# 2
# 3 4

# 出力例 1
# 3.5

# はじめに持っている具材が 2個の場合、それらをともに鍋に入れるほかありません。
# 価値 3,4 の具材から合成される具材の価値は (3+4)/2=3.5です。
# なお、3.50001, 3.49999 などと出力しても正解となります。

# 入力例 2
# 3
# 500 300 200

# 出力例 2
# 375

# 今回ははじめに 3個の具材を持っており、一度目の合成で鍋にどの具材を入れるかに選択の余地があります。選択肢は次の 3通りです。
#     価値 500,300の具材を入れ、価値 (500+300)/2=400 の具材を合成する。この場合、次の合成ではこれと価値 200 の具材を鍋に入れることになり、価値 (400+200)/2=300の具材が合成される。
#     価値 500,200の具材を入れ、価値 (500+200)/2=350 の具材を合成する。この場合、次の合成ではこれと価値 300 の具材を鍋に入れることになり、価値 (350+300)/2=325の具材が合成される。
#     価値 300,200の具材を入れ、価値 (300+200)/2=250 の具材を合成する。この場合、次の合成ではこれと価値 500 の具材を鍋に入れることになり、価値 (250+500)/2=375の具材が合成される。

# よって、最後に残る 1個の具材の価値として考えられる最大の値は 375です。
# なお、375.0 などと出力しても正解となります。

# 入力例 3
# 5
# 138 138 138 138 138

# 出力例 3
# 138


global FLAG_LOG
FLAG_LOG = False


def log(value):
    # FLAG_LOG = True
    # FLAG_LOG = False
    if FLAG_LOG:
        print(str(value))


def calculation(lines):
    # S = lines[0]
    N = int(lines[0])
    # X, A = list(map(int, lines[0].split()))
    values = list(map(int, lines[1].split()))
    # values = list(map(int, lines[2].split()))
    # values = list()
    # for i in range(6):
    #     values.append(int(lines[i]))
    # valueses = list()
    # for i in range(M):
    #     valueses.append(list(map(int, lines[i+1].split())))

    values.sort()

    ave = min(values)
    log(f'ave=[{ave}]')

    for n in range(1, N):
        ave = (ave + values[n]) / 2
        log(f'ave=[{ave}]')

    return [ave]


# 引数を取得
def get_input_lines(lines_count):
    lines = list()
    for _ in range(lines_count):
        lines.append(input())
    return lines


# テストデータ
def get_testdata(pattern):
    if pattern == 1:
        lines_input = ['2', '3 4']
        lines_export = [3.5]
    if pattern == 2:
        lines_input = ['3', '500 300 200']
        lines_export = [375]
    if pattern == 3:
        lines_input = ['5', '138 138 138 138 138']
        lines_export = [138]
    return lines_input, lines_export


# 動作モード判別
def get_mode():
    import sys
    args = sys.argv
    global FLAG_LOG
    if len(args) == 1:
        mode = 0
        FLAG_LOG = False
    else:
        mode = int(args[1])
        FLAG_LOG = True
    return mode


# 主処理
def main():
    import time
    started = time.time()
    mode = get_mode()
    if mode == 0:
        lines_input = get_input_lines(2)
    else:
        lines_input, lines_export = get_testdata(mode)

    lines_result = calculation(lines_input)

    for line_result in lines_result:
        print(line_result)

    # if mode > 0:
    #     print(f'lines_input=[{lines_input}]')
    #     print(f'lines_export=[{lines_export}]')
    #     print(f'lines_result=[{lines_result}]')
    #     if lines_result == lines_export:
    #         print('OK')
    #     else:
    #         print('NG')
    # finished = time.time()
    # duration = finished - started
    # print(f'duration=[{duration}]')


# 起動処理
if __name__ == '__main__':
    main()

Submission status: Accepted

Solution code:
n = int(input())
vn = [int(num) for num in input().split()]

while(len(vn) >= 2):
  vn.sort()
  f = vn.pop(0)
  s = vn.pop(0)
  vn.append((f+s)/2.0)

print(vn[0])

Submission status: Accepted

Solution code:
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

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

v.sort()

value = v[0]

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

print(value)

Submission status: Accepted

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

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(map(float, input().split()))
v.sort()

for _ in range(n-1):
    v[1] = (v[0]+v[1])/2
    v.pop(0)
print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N, *V, = map(int, open(0).read().split())

V.sort(reverse=True)

while True:
    if len(V) == 1:
        break
    V.append((V.pop() + V.pop()) / 2)

print(V[0])

Submission status: Accepted

Solution code:
import sys
from collections import deque
import numpy as np
import math
sys.setrecursionlimit(10**6)
def S(): return sys.stdin.readline().rstrip()
def SL(): return map(str,sys.stdin.readline().rstrip().split())
def I(): return int(sys.stdin.readline().rstrip())
def IL(): return map(int,sys.stdin.readline().rstrip().split())

if __name__=='__main__':
    n = I()
    v = list(IL())
    v.sort(reverse=True)
    while 1<len(v):
        tmp = v.pop()+v.pop()
        v.append(tmp/2)
        v.sort(reverse=True)
    print(v.pop())
    exit()

Submission status: Accepted

Solution code:
N = int(input())
V = sorted(list(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:
from collections import deque
n = int(input())
v = deque(sorted(list(map(int, input().split()))))

while len(v) != 1:
    x = v.popleft()
    y = v.popleft()
    v.appendleft((x+y)/2)
print(v[0])

Submission status: Accepted

Solution code:
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N = int(input())
Vs = list(mapint())
Vs.sort()
val = Vs[0]
for v in Vs[1:]:
    val = (val+v)/2

print(val)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import heapq
N=int(input())
v=list(map(int,input().split()))
heapq.heapify(v)
for x in range(N-1):
  t1=heapq.heappop(v)
  t2=heapq.heappop(v)
  heapq.heappush(v,(t1+t2)/2)
print(heapq.heappop(v))

Submission status: Accepted

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

Submission status: Accepted

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

for _ in range(N - 1):
    v.append((v.pop(-1) + v.pop(-1)) / 2)

print(v[0])

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
T = list(map(int,input().split()))
S = 0
for i in range(len(T)):
    list.sort(T, reverse=False)
    S = (T[0]+T[1])/2
    T.append(S)    
    T.pop(0)
    T.pop(0)
    
    if len(T) ==1:break
print(T[0])

Submission status: Accepted

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

newv = sorted(v)

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

print(newv[n-1])

Submission status: Accepted

Solution code:
from heapq import heappush, heappop, heapify

def readinput():
    n=int(input())
    v=list(map(int,input().split()))
    return n,v

def main(n,v):
    heapify(v)
    while(len(v)>1):
        x=heappop(v)
        y=heappop(v)
        heappush(v,(x+y)/2)
    
    return v[0]

if __name__=='__main__':
    n,v=readinput()
    ans=main(n,v)
    print(ans)

Submission status: Accepted

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

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

v = sorted(v,reverse=True)

for i in range(N-1):
  a = v.pop()
  b = v.pop()
  v.append((a+b)/2)

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

Submission status: Accepted

Solution code:
import heapq
N = int(input())
Nlist = list(map(int, input().split()))
heapq.heapify(Nlist)
for _ in range(N-1):
    x = heapq.heappop(Nlist)
    y = heapq.heappop(Nlist)
    z = (x+y)/2
    heapq.heappush(Nlist, z)

print(Nlist[0])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

value=vn[0]

for i in range(1,N):
    tempV=(value+vn[i])/2
    value=tempV

print(value)

Submission status: Accepted

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

Submission status: Accepted

Solution code:
N = int(input())
v = sorted(list(map(int, input().split())))
while len(v) > 1:
    temp1 = v.pop(0)
    temp2 = v.pop(0)
    temp = (temp1 + temp2) / 2
    v = sorted([temp] + v)
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):
  c = (v[i] + v[i+1])/2
  v[i+1] = c
print(c)

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 = sorted(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())

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

F.sort()

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

Submission status: Accepted

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


resolve()

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

a = sorted(a)
ans = []
for i in range(n-1):
  if i ==0:
    ans.append((a[i]+a[i+1])/2)
  else:
    ans.append((ans[i-1]+a[i+1])/2)
print(ans[n-2])

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

v.sort()

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

print(ans)

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Created: Jul, 14, 2020 09:24:45 by Nobody
# $Author$
# $Date$
# $URL$
__giturl__ = "$URL$"


from collections import defaultdict
from collections import deque
from collections import OrderedDict
import itertools
from sys import stdin
input = stdin.readline


def main():
  N = int(input())
  A = sorted(list(map(int, input().split())))

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


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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
def main():
    n = int(input())
    vlis = list(map(int, input().split()))
    vlis.sort()
    mae = vlis[0]
    for i in range(1, n):
        ato = vlis[i]
        heikin = (mae + ato) / 2
        mae = heikin
    print(heikin)
    
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 range(1, N):
    ans = (ans + v[i]) / 2
print(ans)

Submission status: Accepted

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

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

print(p)

Submission status: Accepted

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

v.sort()

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

print(result)

Submission status: Accepted

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

Submission status: Accepted

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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

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

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

print(ans)

Submission status: Accepted

Solution code:
###==================================================
### import
#import bisect
#from collections import Counter, deque, defaultdict
#from copy import deepcopy
#from functools import reduce, lru_cache
#from heapq import heappush, heappop
#import itertools
#import math
#import string
import sys
### stdin
def input(): return sys.stdin.readline().rstrip()
def iIn(): return int(input())
def iInM(): return map(int, input().split())
def iInM1(): return map(int1, input().split())
def iInLH(): return list(map(int, input().split()))
def iInLH1(): return list(map(int1, input().split()))
def iInLV(n): return [iIn() for _ in range(n)]
def iInLV1(n): return [iIn()-1 for _ in range(n)]
def iInLD(n): return [iInLH() for _ in range(n)]
def iInLD1(n): return [iInLH1() for _ in range(n)]
def sInLH(): return list(input().split())
def sInLV(n): return [input().rstrip('\n') for _ in range(n)]
def sInLD(n): return [sInLH() for _ in range(n)]
### stdout
def OutH(lst, deli=' '): print(deli.join(map(str, lst)))
def OutV(lst): print('\n'.join(map(str, lst)))
### setting
sys.setrecursionlimit(10 ** 6)
### utils
int1 = lambda x: int(x) - 1
### constants
INF = int(1e9)
MOD = 1000000007
dx = (-1, 0, 1, 0)
dy = (0, -1, 0, 1)
###---------------------------------------------------

N = iIn()
V = iInLH()

V.sort()

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

Submission status: Accepted

Solution code:
import sys

# import bisect
# import numpy as np
from collections import deque
# map(int, sys.stdin.read().split())



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


def main():
    N =int(input())
    V =list(map(int,input().split()))
    V.sort()
    sum =V[0]
    for i in range(1,N):
        sum = sum/2 +V[i]/2
    print(sum)



if __name__ == "__main__":
    main()

Submission status: Accepted

Solution code:
N = int(input())
v = list(map(int, input().split()))
ans = min(v)
v.remove(min(v))
for i in range(N-1):
    ans = (ans + min(v)) /2
    v.remove(min(v))

print(ans)

Submission status: Accepted

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

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

Submission status: Accepted

Solution code:
#17
N = int(input())
V = list(map(int,input().split()))
num = 0

V.sort()

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

Submission status: Accepted

Solution code:
def resolve():
    N = int(input())
    V = list(map(int, input().split()))
    import itertools
    ans = 0
    for i in range(N-1):
        V = sorted(V, reverse=True)
        v1 = V.pop()
        v2 = V.pop()
        V.append((v1+v2)/2)
    print(V[0])
    


    
if '__main__' == __name__:
    resolve()

Submission status: Accepted

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

Submission status: Accepted

Solution code:
from collections import deque
n = int(input())
v = sorted(map(float, input().split()))
ans = 0
v = deque(v)
while(len(v) > 1):
    v.appendleft(((v.popleft() + v.popleft()) / 2))
print(v[0])

Submission status: Accepted

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

Submission status: Accepted

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

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

ans=sum(v)

print(ans)

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
n = int(input())
v = list(map(int,input().split()))
v.sort()
ans,tmp = [],[]
gab = (v[0]+v[1])/2
tmp.append(gab)
j = 0
if n == 2:
  print(tmp[0])
  sys.exit()
for i in range(2,n):
  tmp.append((v[i] +tmp[j])/2)
  j += 1
print(tmp[-1])

Submission status: Accepted

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

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

print(result)

Submission status: Accepted

Solution code:
import copy

def solve():
    V = copy.copy(v)
    while len(V) > 1:
#        print(V)
        V.sort()
        tmp = (V[0]+V[1])/2
        del V[0:2]
        V.append(tmp)
    print(V[0])


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

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

Submission status: Accepted

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

Submission status: Accepted

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

Submission status: Accepted

Solution code:
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
def s(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
def gcd(*numbers): reduce(math.gcd, numbers)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
count = 0
ans = 0
inf = float("inf")

n = k()
v = l()
v.sort()

while len(v) != 1:
    x = (v[0]+v[1])/2
    v.append(x)
    del v[0]
    del v[0]
    v.sort()

print(v[0])

Submission status: Accepted

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

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

print(v[0])

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)