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: Wrong Answer

Solution code:
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)


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

v_list = np.array(v_list)


for i in range(n):
	v_list[i] = v_list[i] / (2**(n-i))
v_list[0] = v_list[0] * 2

print(int(np.sum(v_list)))

Submission status: Wrong Answer

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

vc = sorted(v)

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

print(vc[n-1])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

import heapq

heapq.heapify(V)

while len(V) >= 2:
    x = heapq.heappop(V)
    y = heapq.heappop(V)
    heapq.heappush(V, (x + y) // 2)

print(V[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
# coding: utf-8

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

Submission status: Wrong Answer

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

for i in range(N-1):
    V.sort()
    tmp = (V.pop(0) + V.pop(0)) / 2
    V.append(tmp)
    print(V)

print(V[0])

Submission status: Wrong Answer

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

print(v)

sum = v.pop(0)
for i in v:
    sum += i
    sum = sum/2

print(sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
Value = list(map(int,input().split()))
Value = sorted(Value,reverse=True)
Sum = 0.0
for i in Value:
    Sum = (Sum+i)/2.0
print(Sum)

Submission status: Wrong Answer

Solution code:
N = int(input())
v = list(map(int, input().split()))
v = sorted(v)
# print(v)
while len(v) > 1:
    x = (v[0] + v[1]) / 2
    v.append(x)
    del v[:2]
    v = sorted(v)
print(v)

Submission status: Wrong Answer

Solution code:
# C - Alchemist

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

while len(v) > 2:
    pre = v[1] - v[0]
    nxt = v[2] - v[1]
    if pre < nxt:
        v[0] = (v[1] + v[0]) / 2
    else:
        v[2] = (v[2] + v[1]) / 2
    v.pop(1)
print((v[0] + v[1]) / 2)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0
for i in range(int(len(l)+1)):
  for j in reversed(range(i, len(l))):
    if l[j-1]>l[j]:
      l[j-1],l[j] = l[j],l[j-1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
print('{:.10g}'.format(sum(a)/n))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
print('{:105g}'.format(sum(a)/n))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
print('{:.5}'.format(sum(a)/n))

Submission status: Wrong Answer

Solution code:
n = int(input())
a = map(int, input().split())
print(sum(a)/n)

Submission status: Wrong Answer

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: Wrong Answer

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: Wrong Answer

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

v.sort

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

Submission status: Wrong Answer

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

v.sort()

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

print(r)

Submission status: Wrong Answer

Solution code:
n = input()
values = list((input()).split(" "))
v = list(map(lambda x: int(x), values))
result = 0
while len(v) > 0 :
    el = v.pop(0)
    result = (result + el)/2
print(result)

Submission status: Wrong Answer

Solution code:
n = int(input())
arr = [int(x) for x in input().split()]
arr = sum(arr)
print(arr/n)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0
for i in range(int(len(l)+1)):
  for j in reversed(range(i, len(l))):
    if l[j-1]>l[j]:
      l[j-1],l[j] = l[j],l[j-1]

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

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0
for i in range(int(len(l)+1)):
  for j in reversed(range(i, len(l))):
    if l[j-1]>l[j]:
      l[j-1],l[j] = l[j],l[j-1]

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

b.sort()
print(b)

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

print(result)

Submission status: Wrong Answer

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

v.sort

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

Submission status: Wrong Answer

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

v.sort

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

Submission status: Wrong Answer

Solution code:
from heapq import heappush, heappop

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

cnt = 0
while cnt<N-1:
    x = heappop(V)
    y = heappop(V)
    heappush(V, (x+y)/float(2))
    cnt+=1

print(heappop(V))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0

for i in reversed(range(int(len(l)+1))):
  for j in reversed(range(i)):
    print("1")
    print(l[j])
    print(i)
    if l[j] > l[j-1]:
      l[j],l[j-1] = l[j-1],l[j]
      print("2")
      print(l)

print(l)

for i in range(int(Ni)):
  print(l)
  temp = (float(l[i])+float(l[i+1]))/2
  del l[:1]
  print(l)
  l.insert(1, temp)
  print(l)
  
print(temp)

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0

for i in reversed(range(int(N))):
  for j in range(i):
    if l[j] > l[j+1]:
      l[j],l[j+1] = l[j+1],l[j]

for i in range(int(Ni)):
  temp = (float(l[i])+float(l[i+1]))/2
  del l[:1]
  l.insert(1, temp)
  
print(temp)

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
temp = 0

for i in reversed(range(int(N))):
  for j in range(i):
    if l[j] > l[j+1]:
      l[j],l[j+1] = l[j+1],l[j]

for i in range(int(Ni)):
  temp = (int(l[i])+int(l[i+1]))/2
  del l[:1]
  l.insert(1, temp)
  
print(temp)

Submission status: Wrong Answer

Solution code:
N = input()
a = input()
Ni = int(N)-1
l = a.split()
print(l)
temp = 0

for i in reversed(range(int(N))):
  for j in range(i):
    if l[j] > l[j+1]:
      l[j],l[j+1] = l[j+1],l[j]

print(l)

for i in range(int(Ni)):
  print(l)
  temp = (int(l[i])+int(l[i+1]))/2
  del l[:1]
  print(l)
  l.insert(1, temp)
  print(l)
  
print(temp)

Submission status: Wrong Answer

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

v.sort

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

Submission status: Wrong Answer

Solution code:
N = int(input())

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

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

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

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

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

print(int(total_value))

Submission status: Wrong Answer

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

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

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

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

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

def ave(c1,c2):
  av = (c1 + c2)/2
  return av

for i in range(N-1):
  for j in range(i+1,N):
    if a[j] <= a[i]:
      tmp = a[i]
      a[i] = a[j]
      a[j] =tmp
for i in range(N-1):
  average = ave(a[0],a[1])
  a.pop(0)
  a.pop(0)
  a.insert(0,average)

print(int(a[0]))

Submission status: Wrong Answer

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

def ave(c1,c2):
  av = (c1 + c2)/2
  return av

for i in range(N-1):
  for j in range(i+1,N):
    if a[j] <= a[i]:
      tmp = a[i]
      a[i] = a[j]
      a[j] =tmp


for i in range(N-1):
  average = ave(a[0],a[1])
  a.pop(0)
  a.pop(0)
  a.insert(0,average)

print(int(a[0]))

Submission status: Wrong Answer

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

def ave(c1,c2):
  av = (c1 + c2)/2
  return av

for i in range(N-1):
  for j in range(i+1,N):
    if a[j] <= a[i]:
      tmp = a[i]
      a[i] = a[j]
      a[j] =tmp
print(a)

for i in range(N-1):
  average = ave(a[0],a[1])
  a.pop(0)
  a.pop(0)
  a.insert(0,average)

print(int(a[0]))

Submission status: Wrong Answer

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

def ave(c1,c2):
  av = (c1 + c2)/2
  return av

for i in range(N-1):
  for j in range(i+1,N):
    if a[j] <= a[i]:
      tmp = a[i]
      a[i] = a[j]
      a[j] =tmp
print(a)

for i in range(N-1):
  average = ave(a[0],a[1])
  a.pop(0)
  a.pop(0)
  a.insert(0,average)

print(a[0])

Submission status: Wrong Answer

Solution code:
import random

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

def ave(c1,c2):
  av = (c1 + c2)/2
  return av

for i in range(N-1):
  for j in range(i+1,N):
    if a[j] >= a[i]:
      tmp = a[i]
      a[i] = a[j]
      a[j] =tmp
print(a)

for i in range(N-1):
  average = ave(a[0],a[1])
  a.pop(0)
  a.pop(0)
  a.insert(0,average)

print(a[0])

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:

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

Submission status: Wrong Answer

Solution code:
#import sys
#input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
print(1.0/sum(list(map(lambda x: 1.0 / x, a))))

Submission status: Wrong Answer

Solution code:
import sys
input = sys.stdin.readline
n = int(input())
a = list(map(int, input().split()))
print(1.0/sum(list(map(lambda x: 1.0 / x, a))))

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

Solution code:
from heapq import heappush,heappop
n = int(input())
v = list(map(int,input().split()))

ans = 0
for i in range(n-1):
	a = heappop(v)
	b = heappop(v)
	ab = (a+b)/2
	ans += ab
	heappush(v,ab)
print(v[0])

Submission status: Wrong Answer

Solution code:
n,arr = int(input()),list(map(int,input().split(' ')))
stack = []
arr = sorted(arr)
for i in range(0,len(arr),2):
    if i == len(arr)-1:
        print(int((stack[-1] + arr[i])/2))
    else:
        stack.append((arr[i] + arr[i+1])/2)

Submission status: Wrong Answer

Solution code:
n,arr = int(input()),list(map(int,input().split(' ')))
stack = []
arr = sorted(arr)
for i in range(0,len(arr),2):
    if i == len(arr)-1:
        print((stack[-1] + arr[i])/2)
    else:
        stack.append((arr[i] + arr[i+1])/2)

Submission status: Wrong Answer

Solution code:
#from functools import reduce
N = int(input())
Xs = list(map(int,input().split()))
Xs_ = sorted(Xs)
print(sum([Xs_[i]*(2**(-N)) if i == 0 else Xs_[i]* (2**(-N-i+1)) for i in range(N)]))

Submission status: Wrong Answer

Solution code:
#from functools import reduce
N = int(input())
Xs = list(map(int,input().split()))
Xs_ = sorted(Xs)
print(sum([Xs_[i]*(2**(-N)) if i == 0 else Xs_[i]* (2**(-N+i-1)) for i in range(N)]))

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
V = list(map(int, input().split()))
V.sort()
ans = 0
for i in range(N//2):
    tmp = (V[2*i] + V[2*i+1]) / 2
    if i == 0:
        ans = tmp
    else:
        ans = (ans + tmp) / 2
if N % 2 == 1:
    ans = (ans + V[-1]) / 2
print(ans)

Submission status: Wrong Answer

Solution code:
# coding: utf-8
N = int(input())
V = list(map(int, input().split()))
V.sort()
print(V)
ans = 0
for i in range(N//2):
    tmp = (V[2*i] + V[2*i+1]) / 2
    if i == 0:
        ans = tmp
    else:
        ans = (ans + tmp) / 2
if N % 2 == 1:
    ans = (ans + V[-1]) / 2
print(ans)

Submission status: Wrong Answer

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

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

print(v[0])

Submission status: Wrong Answer

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

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
import numpy as np
a = int(input())
b = np.array([int(i) for i in input().split()])
b = np.sort(b)
while len(b) != 1:
  c = np.delete(b,0)
  c = np.delete(c,0)
  c = np.append(c,(b[0] + b[1])/2)
  b = np.sort(c)
print(b)

Submission status: Wrong Answer

Solution code:
N =int(input())
A = sorted([int(a) for a in input().split()],reverse=True)
if N  == 2:
  print(sum(A)/2)
else :
  print(((A[2] + A[1])/2 + A[0]) / 2)

Submission status: Wrong Answer

Solution code:
N =int(input())
A = sorted([int(a) for a in input().split()],reverse=True)
if N  == 2:
  print(round(sum(A)/2))
else :
  print(round(((A[2] + A[1])/2 + A[0]) / 2))

Submission status: Wrong Answer

Solution code:
N =int(input())
A = sorted([int(a) for a in input().split()],reverse=True)
if N  == 2:
  print(round(sum(A)/2))
else :
  print(((A[2] + A[1])/2 + A[0]) / 2)

Submission status: Wrong Answer

Solution code:
n = int(input())
v_list = list(map(int, input().split()))
while len(v_list) != 1:
    sorted(v_list)
    a = v_list.pop()
    b = v_list.pop()
    v_list.append((a + b) / 2)
print(v_list[0])

Submission status: Wrong Answer

Solution code:
n = int(input())
v_list = list(map(int, input().split()))
while len(v_list) != 1:
    sorted(v_list)
    a = v_list.pop()
    b = v_list.pop()
    new = (a + b) / 2
    v_list.append(new)
print(v_list[0])

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n = int(input())
v_list = list(map(int, input().split()))
while len(v_list) != 1:
    sorted(v_list)
    a = v_list.pop(-1)
    b = v_list.pop(-1)
    new = (a + b) / 2
    v_list.append(new)
print(v_list[0])

Submission status: Wrong Answer

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

print(V[N-1])

Submission status: Wrong Answer

Solution code:
import random

def main():
    inputs = [input() for _ in range(2)]
    N = int(inputs[0])
    ingredients = [float(i) for i in inputs[1].split(' ')]

    for _ in range(N-1):
        curr_N = len(ingredients)
        index_x, index_y = random.sample(range(curr_N), 2)
        if index_x < index_y:
            index_x, index_y = index_y, index_x
        new_ingredient = (ingredients.pop(index_x) + ingredients.pop(index_y)) / 2.
        ingredients.append(new_ingredient)
    
    if len(ingredients) == 1:
        print(ingredients[0])

if __name__ == '__main__':
    main()

Submission status: Wrong Answer

Solution code:
print(1000)

Submission status: Wrong Answer

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

d.sort(reverse=True)

S = (d[0] + d[1])/2

for i in range(2,N):
  S = (S + d[i])/2

print(S)
#print(list(map(int,input().split())).sort(reverse=True))

Submission status: Wrong Answer

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

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

print(u)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
vn_list = input().split()

vn = np.sort(np.array(vn_list, dtype="float"))[::-1]
print(vn)
w = np.logspace(1, N, base=1/2, num = N)
w[N-1] = w[N-2]
result = np.dot(vn, w)
print(result)

Submission status: Wrong Answer

Solution code:
import numpy as np

N = int(input())
vn_list = input().split()

vn = np.array(vn_list, dtype="float")
w = np.logspace(1, N, base=1/2, num = N)
w[N-1] = w[N-2]
result = np.dot(vn, w)
print(result)

Submission status: Wrong Answer

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

from heapq import *
que = []
heapify(que)

for v in v_list:
    heappush(que, -v)

while len(que) != 1:
    a = que.pop()
    b = que.pop()
    heappush(que, (a+b)/2)
print(abs(que.pop()))

Submission status: Wrong Answer

Solution code:
#ACB138 C1

N=int(input())

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


def merge(mylist):
	mylist=sorted(mylist)
	curval=0
	if len(mylist)<=1:
		return mylist[0]

	curval = mylist[0]+mylist[1]
	mylist.pop(1)
	mylist.pop(0)
	mylist.append(curval/2)
	print(mylist)
	return merge(mylist)

print(merge(V))

Submission status: Wrong Answer

Solution code:
#ACB138 C1

N=int(input())

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


def merge(mylist):
	mylist=sorted(mylist)
	curval=0
	curlist=[]
	if len(mylist)<2:
		return mylist[0]

	curval = mylist[0]+mylist[1]
	curlist.append(curval/2)
	if len(mylist) %2 !=0:
		curlist.append(mylist[-1])
	return merge(curlist)

print(merge(V))

Submission status: Wrong Answer

Solution code:
#ACB138 C1

N=int(input())

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


def merge(mylist):
	mylist=sorted(mylist)
	curval=0
	curlist=[]
	if len(mylist)<2:
		return mylist[0]

	for i in range(0,len(mylist)-1,2):
		curval = mylist[i]+mylist[i+1]
		curlist.append(curval/2)
	if len(mylist) %2 !=0:
		curlist.append(mylist[-1])
	return merge(curlist)

print(merge(V))

Submission status: Wrong Answer

Solution code:
#ACB138 C1

N=int(input())

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

V2=sorted(V)

def merge(mylist):
	curval=0
	curlist=[]
	if len(mylist)<2:
		return mylist[0]

	for i in range(0,len(mylist)-1,2):
		curval = mylist[i]+mylist[i+1]
		curlist.append(curval/2)
	if len(mylist) %2 !=0:
		curlist.append(mylist[-1])
	return merge(curlist)

print(merge(V2))

Submission status: Wrong Answer

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

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

print(ans)

Submission status: Wrong Answer

Solution code:
from __future__ import division
n = int(raw_input())
v = map(int,raw_input().split())
while len(v) >= 2:
  a = v.pop(0)
  b = v.pop(0)
  v.append((a+b)/2)
  v = sorted(v)
print v[0]

Submission status: Wrong Answer

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

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

while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
res = v[-1]
if res.is_integer():
    print(int(res))
else:
    print(res)

Submission status: Wrong Answer

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

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

while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())

Submission status: Wrong Answer

Solution code:
# coding: utf-8
# Your code here!
# ABC138C
 
n = int(input())
v = list(map(int, input().split()))
print(v)
while len(v) > 1:
    a = min(v)
    v.remove(a)
    print(a,v)
    b = min(v)
    v.remove(b)
    print(b,v)
    c = (a + b) / 2
    v.append(c)
    
print(v.pop())

Submission status: Wrong Answer

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

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

print(int(V[-1]))

Submission status: Wrong Answer

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]) / 2
print(ans)

Submission status: Wrong Answer

Solution code:
from collections import deque
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
vi = deque(v)
while len(vi) != 1:
	v0 = vi.popleft()
	v1 = vi.popleft()
	vadd = (v0+v1)/2
	vi.appendleft(vadd)
print(int(vi[0]))

Submission status: Wrong Answer

Solution code:
import sys
length = int(input())
sum = 0.0
input_str = input().split(" ")
input_str.sort();
sum = int(input_str[0])
for  i in range(1, length):
  sum += int(input_str[i])
  sum /= 2
  
print(sum);

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

answer = 0

if n == 2:
    answer = ((v[0]+v[1]) / 2)
else:
    for i in range(n):
        if i < 1:
            answer = ((v[i]+v[i+1]) / 2)
        else:
            answer = ((v[i]+answer) / 2)

print(answer)

Submission status: Wrong Answer

Solution code:
import random
num = int(input())
s =list(map(int,input().split()))
s =sorted(s)
a = s[0]


print(a)
for i in range(num):
  a=(a+s[i])/2
print(a)

Submission status: Wrong Answer

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

for i in range(1, n):
    sum = (sum + lst[i]) / 2
print(int(sum))

Submission status: Wrong Answer

Solution code:
a = int(input())
Lists = sorted(list(map(int, input().split())))
print(Lists)

ans = Lists[0]

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

print(ans)

Submission status: Wrong Answer

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

Submission status: Wrong Answer

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

nums.sort()

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

print(int(nums[n-1]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
n=int(input())
v=input().split()
w=sorted(v)
a=1
x=int(w[0])
x=x
while a<=n-1:
  y=int(w[a])
  z=float(x)+float(y)
  x=float(z)/float(2)
  a=a+1
print(x)

Submission status: Wrong Answer

Solution code:
N = int(input())
v = input().split()
v.sort()
for i in range(N-1):
  x = (float(v[0]) + float(v[1])) / 2
  x = str(x)
  v.append(x)
  #print(v)
  v.pop(0)
  v.pop(0)
  v.sort()
print(float(v[0]))

Submission status: Wrong Answer

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

Submission status: Wrong Answer

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
ansa = []
if a > 2:
 while num < a:
   if num ==0:
    zero = (List[num] + List[num+1])/2
    ans.append(zero)
    num = num + 1
   else:
    resa = (ans[-1] + List[num+1])/2
    if num>a-2:
     break 
 print(resa)
else:
 print((List[0] + List[1])/2)

Submission status: Wrong Answer

Solution code:
n = int(input())
a = list(map(int, input().split()))
bo = sum(map(lambda x: 1/x, a))
print(1/bo)

Submission status: Wrong Answer

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

print(v[:n])

v.sort()

count=1
while count < n:
    v[0]=(v[0]+v[count])/2
    count+=1


print(v[0])