AtCoder Beginner Contest 138 - Alchemist

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-----
2
3 4

-----Sample Output-----
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.

Source: atcoder | Difficulty: EASY


Solutions:
N = int(input())
A = list(map(int, input().split()))
A.sort()
ans = A[0]
for i in range(1, N):
	ans = (ans + A[i]) / 2
print(ans)


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


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


N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
val = ls[0]
if N >= 2:
	for i in ls:
		val = (val + i) / 2
print(val)


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


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


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


n = int(input())
v = [int(i) for i in input().split()]
for _ in range(n - 1):
	v.sort()
	v[:2] = [sum(v[:2]) / 2]
print(v[0])


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

def __starting_point():
	main()
__starting_point()


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


input()
l = sorted(map(int, input().split()))
v = l[0]
for i in l:
	v = (v + i) / 2
print(v)


(n, *a) = map(int, open(0).read().split())
a.sort()
tmp = (a[0] + a[1]) / 2
for i in range(2, n):
	tmp = (tmp + a[i]) / 2
print(tmp)


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


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


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


N = int(input())
A = list(map(float, input().split()))
A.sort()
ans = A[0] / 2 ** N
for a in A:
	ans += a / 2 ** N
	N -= 1
print(ans)


input()
(p, *v) = sorted(map(int, input().split()))
for x in v:
	p = (p + x) / 2
print(p)


n = int(input())
v = sorted(list(map(int, input().split())))
ss = v.pop(0)
for i in v:
	ss = (ss + i) / 2
print(ss)


_ = input()
(*v,) = map(int, input().split())
v.sort()
while len(v) >= 2:
	v = [(v[0] + v[1]) / 2] + v[2:]
print(v[0])


N = int(input())
vlist = list(map(int, input().split()))
vlist.sort()
ans = 0
for i in range(N):
	if i == 0:
		ans += vlist[i]
	else:
		ans = (ans + vlist[i]) / 2
print(ans)


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


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


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


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


n = int(input())
guzai = list(map(int, input().split()))
guzai.sort()
ave = (guzai[0] + guzai[1]) / 2
for x in range(2, n):
	ave = (ave + guzai[x]) / 2
print(ave)


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


N = int(input())
A = list(map(int, input().split()))
A.sort()
r = A[0]
for i in range(1, N, 1):
	r = float((r + A[i]) / 2)
print(r)


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


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


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


N = int(input())
v = list(map(int, input().split()))
v.sort()
while True:
	x = v[0]
	y = v[1]
	z = (x + y) / 2
	v.pop(0)
	v.pop(0)
	v.append(z)
	v.sort()
	if len(v) == 1:
		break
	else:
		pass
print(z)


n = int(input())
l = [int(x) for x in input().split()]
l.sort()
res = l[0]
for i in l:
	res = (res + i) / 2
print(res)


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


input()
v = sorted(map(int, input().split()))
a = v.pop(0)
while v:
	a = (a + v.pop(0)) / 2
print(a)


_ = input()
(_v, *v) = sorted(map(int, input().split()))
for i in v:
	_v = (_v + i) / 2
print(_v)


n = int(input())
a = [0] * n
a[:] = map(int, input().split())
a.sort()
r = a[0]
for ii in range(n - 1):
	r = (r + a[ii + 1]) / 2
print(r)


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


N = int(input())
A = list(map(int, input().split()))
A = sorted(A)
if N == 2:
	print(sum(A) / 2)
	return
else:
	temp = (A[0] + A[1]) / 2
	for i in range(2, N):
		temp = 1 / 2 * (A[i] + temp)
print(temp)


n = int(input())
v_list = sorted(list(map(int, input().split())))
c = v_list[0]
for v in v_list:
	c = (c + v) / 2
print(c)


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


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)


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)


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


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)


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


N = int(input())
v = [int(c) for c in input().split()]
v.sort()
tmp = 0.0
for i in range(N):
	if i == 0:
		tmp = v[i]
	else:
		tmp = (tmp + v[i]) / 2.0
print(tmp)


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


n = int(input())
v = list(map(float, input().split()))
v.sort()
t = v[0]
for v2 in v[1:]:
	t += v2
	t /= 2.0
print(t)


input()
l = sorted(map(int, input().split()))
a = l.pop(0)
for i in l:
	a = (a + i) / 2
print(a)


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


n = int(input())
a = sorted([int(i) for i in input().split()])
c = a[0]
for i in a[1:]:
	c = (c + i) / 2
print(c)


t = int(input())
l = sorted(map(int, input().split()))
s = l[0]
for i in range(1, t):
	s += l[i]
	s /= 2
print(s)


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


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


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


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


N = int(input())
V = sorted(list(map(int, input().split())))
ans = V.pop(0)
for i in V:
	ans = (ans + i) / 2
print(ans)


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


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


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)


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


n = int(input())
v = list(map(int, input().split()))
v = sorted(v)
ans = v[0]
for i in range(1, n):
	ans = (ans + v[i]) / 2
print('{:.6f}'.format(ans))


n = int(input())
v = list(map(int, input().split()))
v.sort()
c = v[0]
for a in v[1:]:
	c = (c + a) / 2
print(c)


n = int(input())
s = [int(i) for i in input().split()]
s.sort()
ans = s[0]
for i in s:
	ans = (ans + i) / 2
print(ans)


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


n = int(input())
v = sorted([int(i) for i in input().split()], reverse=True)
for i in range(n - 1):
	v[i] /= 2 ** (i + 1)
v[n - 1] /= 2 ** (n - 1)
print(sum(v))


def resolve():
	n = int(input())
	v = list(map(int, input().split()))
	v.sort(reverse=True)
	for _ in range(n - 1):
		v = v[:-2] + [(v[-1] + v[-2]) / 2]
	print(v[0])
resolve()


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


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


N = int(input())
A = sorted(map(int, input().split()))
ANS = A[0]
for a in A[1:]:
	ANS = (ANS + a) / 2
print(ANS)


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


import heapq
INT = lambda : int(input())
INTM = lambda : map(int, input().split())
STRM = lambda : map(str, input().split())
STR = lambda : str(input())
LIST = lambda : list(map(int, input().split()))
LISTS = lambda : list(map(str, input().split()))

def do():
	n = INT()
	v = LIST()
	heapq.heapify(v)
	for i in range(n - 1):
		a = heapq.heappop(v)
		b = heapq.heappop(v)
		heapq.heappush(v, (a + b) / 2)
	print(heapq.heappop(v))

def __starting_point():
	do()
__starting_point()


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


input()
v = list(map(int, input().split()))
v.sort()
(ans, *v) = v
for vi in v:
	ans = (ans + vi) / 2
print(ans)


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


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


n = int(input())
v = [int(x.strip()) for x in input().split()]
vs = sorted(v)
ans = 0
for i in range(n):
	a = vs[i] / 2 ** (n - max(i, 1))
	ans += a
print(ans)


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


_ = input()
li = list(map(int, input().split()))
li.sort()
result = li[0]
for i in li:
	result += i
	result /= 2
print(result)


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


N = int(input())
v = list(map(int, input().split()))
vs = sorted(v)
alc = 0
for i in range(N):
	if alc == 0:
		alc = vs[0]
	else:
		alc = (alc + vs[i]) / 2
print(alc)


n = int(input())
v = list(map(int, input().split()))
v.sort()
x = v.pop(0)
for a in v:
	x += a
	x /= 2
print(x)


N = int(input())
A = list(map(int, input().split()))
A = sorted(A, reverse=True)
ans = 0
a = 1
for i in range(N):
	if i != N - 1:
		a *= 0.5
	ans += a * A[i]
print(ans)


N = int(input())
ls = list(map(int, input().split(' ')))
ls.sort()
rst = ls[0]
if N >= 2:
	for i in ls[1:]:
		rst = (rst + i) / 2
print(rst)


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


_n = input()
v = map(int, input().split())
v2 = sorted(v)
s = v2[0]
for i in v2[1:]:
	s = (s + i) / 2
print(s)


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


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


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


n = int(input())
l = list(map(int, input().split()))
l.sort()
b = l.pop(0)
for i in l:
	b = (b + i) / 2
print(b)


input()
M = sorted(list(map(int, input().split())))
D = M.pop(0)
for N in M:
	D = (D + N) / 2
print(D)


input()
vs = list(sorted(map(int, input().split(' '))))
s = vs[0]
for v in vs[1:]:
	s += v
	s /= 2.0
print('%.7f' % s)


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


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


(_, *a) = map(int, open(0).read().split())
a.sort()
ans = a.pop(0)
for i in a:
	ans = (ans + i) / 2
print(ans)


(n, *v) = map(int, open(0).read().split())
v.sort()
print(v[0] / 2 ** n + sum((v[i] / 2 ** (n - i) for i in range(n))))


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


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


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


n = int(input())
v = [int(x) for x in input().split()]
v.sort()
s = v[0]
for i in v[1:]:
	s = (s + i) / 2
print(s)


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


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

class Solution:

	def __init__(self, n, vn):
		self.n = n
		self.vn = vn

	def answer(self):
		ans = vn[0]
		for i in range(1, self.n):
			ans = (ans + self.vn[i]) / 2
		print(ans)
conditions = Solution(n, vn)
conditions.answer()


n = int(input())
ls = list(map(int, input().split()))
ls.sort()
ans = ls[0]
ls.pop(0)
for l in ls:
	ans = (ans + l) / 2
print(ans)


from functools import reduce
input()
print(reduce(lambda a, b: (a + b) / 2, sorted(map(int, input().split()))))


M = int(input())
A = list(map(int, input().split()))
A.sort()
count = 0
count = (A[0] + A[1]) / 2
for i in range(2, M):
	count = (count + A[i]) / 2
print(count)


def cumsum(n, A):
	s = [0] * (n + 1)
	s[0] = A[0]
	for i in range(len(A)):
		s[i + 1] = (s[i] + A[i]) / 2
	return s
n = int(input())
v = sorted(list(map(int, input().split())))
for i in range(n - 1):
	s = cumsum(n, v)
print(s[-1])


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


N = int(input())
v = [int(i) for i in input().split()]
w = sorted(v)
ans = w[0] + w[1]
if N == 2:
	ans /= 2
else:
	for i in range(2, N):
		ans += 2 ** (i - 1) * w[i]
	ans /= 2 ** (N - 1)
print(ans)


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


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


N = int(input())
v = sorted([int(i) for i in input().split()])
for i in range(N - 1):
	a = v.pop(0)
	b = v.pop(0)
	v.append((a + b) / 2)
	v.sort()
print(v[0])


n = int(input())
v = list(map(int, input().split()))
v.sort()
t = float(v[0] + v[1]) / 2
for i in range(2, n, 1):
	t = float(t + v[i]) / 2
print('{:.05f}'.format(t))


n = int(input()) - 1
d = sorted(list(map(int, input().split())))
for i in range(0, n):
	d[1] = sum(d[:2]) / 2
	d.pop(0)
print(d[0])


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

def __starting_point():
	main()
__starting_point()


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)


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


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


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


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


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


n = int(input())
l = sorted(map(int, input().split()))[::-1]
print(sum((l[i] * 0.5 ** (-~i) for i in range(n))) + l[-1] * 0.5 ** n)


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)


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


N = int(input())
A = list(map(int, input().split()))
A.sort()
x = A[0]
for a in A:
	x = (x + a) / 2
print('{}'.format(x))


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


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


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


n = int(input())
a = list(sorted(map(int, input().split())))
v = a[0]
for b in a[1:]:
	v = (v + b) / 2
print(v)


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


from functools import reduce
input()
print(reduce(lambda x, y: (x + y) / 2, sorted((int(x) for x in input().split()))))


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


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


import sys
input = sys.stdin.readline
import heapq

def main():
	n = int(input())
	values = []
	heap_values = []
	values = list(map(int, input().split()))
	[heapq.heappush(heap_values, value) for value in values]
	while len(heap_values) != 1:
		tmp1 = heapq.heappop(heap_values)
		tmp2 = heapq.heappop(heap_values)
		tmp_value = (tmp1 + tmp2) / 2
		heapq.heappush(heap_values, tmp_value)
	print(heap_values[0])

def __starting_point():
	main()
__starting_point()


n = int(input())
v = list(map(int, input().split()))
while len(v) != 1:
	v.sort()
	v[0] = (v[0] + v[1]) / 2
	v.pop(1)
print(v[0])


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


N = int(input())
V = list(map(int, input().split()))
V.sort()
x = V.pop(0)
for v in V:
	x = (x + v) / 2.0
print(x)


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


N = int(input())
materials = list(map(int, input().split()))
for _ in range(N - 1):
	materials.sort()
	new_material = (materials[0] + materials[1]) / 2
	materials.pop(0)
	materials.pop(0)
	materials.append(new_material)
print(materials[0])


import itertools
N = int(input())
v = list(map(int, input().split()))
for _ in range(N - 1):
	c = list(itertools.combinations(v, 2))
	x = 10000
	idx = None
	for (i, j) in enumerate(c):
		a = (j[0] + j[1]) / 2
		if x > a:
			x = a
			idx = i
	n = v.index(c[idx][0])
	v.pop(n)
	m = v.index(c[idx][1])
	v.pop(m)
	v.append(x)
print(v[0])


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


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


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


n = int(input())
l = sorted(list(map(int, input().split())))
ans = l.pop(0)
for i in l:
	ans = (ans + i) / 2
print(ans)


n = int(input())
l = sorted(map(int, input().split()))[::-1]
for i in range(n - 1):
	l += [(l.pop() + l.pop()) / 2]
print(l[0])


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


N = int(input())
V = [int(x) for x in input().split()]
V.sort()
ans = V[0]
for i in V:
	ans = (ans + i) / 2
print(ans)


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


input()
v = sorted(map(int, input().split()))
r = v[0]
for x in v:
	r = (r + x) / 2
print(r)


import heapq

def main():
	n = int(input())
	values = [int(i) for i in input().split()]
	heapq.heapify(values)
	for i in range(n - 1):
		a = heapq.heappop(values)
		b = heapq.heappop(values)
		heapq.heappush(values, (a + b) / 2)
	ans = heapq.heappop(values)
	print(ans)

def __starting_point():
	main()
__starting_point()


N = int(input())
(r, *v) = sorted(list(map(int, input().split())))
for x in v:
	r = (r + x) / 2
print(r)


n = int(input())
v = [int(n) for n in input().split()]
v = sorted(v)
ans = v[0]
for num in v[1:]:
	ans = (ans + num) / 2
print(ans)


(_, v) = open(0)
(s, *v) = sorted(map(int, v.split()))
for i in v:
	s = (s + i) / 2
print(s)


n = int(input())
v = list(map(int, input().split()))
for i in range(n - 1):
	a = min(v)
	v.remove(a)
	b = min(v)
	v.remove(b)
	new = (a + b) / 2
	v.append(new)
print(new)


def solve():
	N = int(input())
	A = list(map(int, input().split()))
	A.sort()
	for i in range(N - 1):
		A[i + 1] = (A[i + 1] + A[i]) / 2
	print(A[-1])
	return
solve()


_ = input()
v = list(map(int, input().split()))
v.sort()
num = v[0]
for i in v:
	num = (num + i) / 2
print(num)


n = int(input())
(*V,) = map(int, input().split())
V.sort()
a = V[0]
for v in V[1:]:
	a = (a + v) / 2
print(a)


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


input()
ns = sorted(map(int, input().split()))
s = ns.pop(0)
for n in ns:
	s = (s + n) / 2
print(s)


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


n = int(input())
v = [int(i) for i in input().split()]
v.sort()
ans = v[0]
for i in v[1:]:
	ans = (ans + i) * 0.5
print(ans)


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


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)


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)


N = int(input())
V = list(map(int, input().split()))
V.sort()
ans = V[0]
for v in V:
	ans = (ans + v) / 2
print(ans)


n = int(input())
s = list(map(int, input().split()))
s.sort()
v = 0
if n == 1:
	print(s[0])
	return
elif n == 2:
	print((s[0] + s[1]) / 2)
	return
c = (s[0] + s[1]) / 2
del s[0]
del s[0]
for i in range(n - 2):
	c = (c + s[0]) / 2
	del s[0]
print(c)


N = int(input())
a = list(map(int, input().split()))
a = sorted(a, reverse=False)
for i in range(N - 1):
	a[i + 1] = (a[i] + a[i + 1]) / 2
print(a[N - 1])


import sys
import math
from collections import defaultdict, deque, Counter
from copy import deepcopy
from bisect import bisect, bisect_right, bisect_left
from heapq import heapify, heappop, heappush
input = sys.stdin.readline

def RD():
	return input().rstrip()

def F():
	return float(input().rstrip())

def I():
	return int(input().rstrip())

def MI():
	return map(int, input().split())

def MF():
	return map(float, input().split())

def LI():
	return list(map(int, input().split()))

def TI():
	return tuple(map(int, input().split()))

def LF():
	return list(map(float, input().split()))

def Init(H, W, num):
	return [[num for i in range(W)] for j in range(H)]

def main():
	N = I()
	L = LI()
	L.sort()
	ans = L[0]
	for i in L[1:]:
		ans = (ans + i) / 2
	print(ans)

def __starting_point():
	main()
__starting_point()


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


input()
a = sorted(map(int, input().split()))
while len(a) > 1:
	a.append((a.pop(0) + a.pop(0)) / 2)
	a.sort()
print(*a)


(_, l) = open(0)
(p, *v) = sorted(map(int, l.split()))
for x in v:
	p = (p + x) / 2
print(p)


(N, *V) = map(int, open(0).read().split())
A = sorted(V)
for n in range(N - 1):
	A = sorted([(A[0] + A[1]) / 2] + A[2:])
print(A[0])


input()
X = sorted(list(map(int, input().split())))
p = X[0]
for x in X[1:]:
	p = (p + x) / 2
print(p)


N = int(input())
V = [int(x) for x in input().split()]
V.sort()
r = V[0]
for v in V[1:]:
	r = (r + v) / 2
print(r)


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


N = int(input())
v = list(map(int, input().split()))
v.sort()
b = v[0]
for a in v[1:]:
	b = (a + b) / 2
print(b)