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: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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: Runtime Error

Solution code:
ans = (ans + v[i])/2

Submission status: Runtime Error

Solution code:
N = int(input())
L = list(map(int, input()))
L.sorted
ans = reduce(lambda x, y: (x + y)/2, L)
print(ans)

Submission status: Runtime Error

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

sorted_list = sorted(a)
print(sorted_list)
num = 0
last_num = 0

for i in range(N):
    if len(sorted_list) == 1:
        if i == 0:
            last_num = sorted_list[num]
        last_num = (sorted_list[num] + last_num) / 2
        break
    x = sorted_list[num]
    y = sorted_list[num+1]
    z = (x + y) / 2
    last_num = z
    sorted_list.pop(num)
    sorted_list.pop(num)

print(last_num)

Submission status: Runtime Error

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

sorted_list = sorted(a)
print(sorted_list)
num = 0
last_num = 0

for i in range(N):
    if len(sorted_list) == 1:
        if i == 0:
            last_num = sorted_list[num]
        last_num = (sorted_list[num] + last_num) / 2
        break
    x = sorted_list[num]
    y = sorted_list[num+1]
    z = (x + y) / 2
    last_sum = z
    sorted_list.pop(num)
    sorted_list.pop(num)

print(last_num)

Submission status: Runtime Error

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

sorted_list = sorted(a)
print(sorted_list)
num = 0
last_sum = 0
for i in range(N):
    if len(sorted_list) == 1:
        last_sum = (sorted_list[num] + last_sum) / 2
        break
    x = sorted_list[num]
    y = sorted_list[num+1]
    z = (x + y) / 2
    last_sum = z
    sorted_list.pop(num)
    sorted_list.pop(num)

print(last_sum)

Submission status: Runtime Error

Solution code:
N = int(input())
list = []

for i in range(N):
    cost = int(input())
    list.append(cost)
    
new_list = sorted(list)
print(new_list)

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

Submission status: Runtime Error

Solution code:
N = int(input())
*V, = map(int, input().split())
V.sort()
ans = V[0]
for i in range(1, N):
    ans = mix(ans,V[i])
print(ans)

Submission status: Runtime Error

Solution code:
from math import floor


def main():
    N = int(input())
    v = list(map(int, input().split(" ")))
    while len(v) > 1:
        v.sort()
        w = []
        if len(v) % 2 == 1:
            w.append(v[-1])
            N -= 1
        for i in range(floor(N / 2)):
            w.append((v[i * 2] + v[i * 2 + 1]) / 2)
        v = w
    print(v[0])


if __name__ == '__main__':
    main()

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include <bits/stdc++.h>
using namespace std;

int main(){
	int N;
	cin >> N;
	vector<int> vec(N);
	for(int i=0;i<N;i++){
		cin >> vec.at(i);
	}
	sort(vec.begin(), vec.end());
	double ans = vec.at(0);
	for(int i=1;i<N;i++){
		ans = (ans+vec.at(i))/2;
	}
	cout << ans << endl;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
v=[]
for i in range(n):
  v.append(input())
v.sort()
s=0
while(len(v)>1):
    v0=v.pop(0)
    v1=v.pop(0)
    v.append((v0+v1)/2)
    v.sort()
print(v[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
v=[]
for i in range(n):
  v1=[int(i) for i input().split()]
  v.append(v1)
v.sort()
for j in range(n-1):
  x=(v[0]+v[1])/2
  v[1]=x
  v.remove(v[0])

print(v)

Submission status: Runtime Error

Solution code:
def  makabe((float)num, (float)ko):
  ky=(num+ko)/2
  return ky



n=int(input())
g=list(map(float,input().split()))
g.sort()
ty=(g[0]+g[1])/2
for h in range(2,n):
  ty= makabe(ty,g[h])
  
print(ty)

Submission status: Runtime Error

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

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

 print(A[N-1])

Submission status: Runtime Error

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

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

 print(A[N-1])

Submission status: Runtime Error

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

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

 print(A[N-1])

Submission status: Runtime Error

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

for i in range N-1
	A[i+1] = A[i] + A[i+1]

 print(A[N-1])

Submission status: Runtime Error

Solution code:
import heapq
import math


def solve(n, v):
    heapq.heapify(v)
    nn = math.ceil(n / 2)

    while len(nn) != 1:
        x = heapq.heappop(v)
        y = heapq.heappop(v)
        z = (x + y) / 2
        heapq.heappush(v, z)

    return v[0]


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

print(solve(n, v))

Submission status: Runtime Error

Solution code:
import math
import heapq

N=int(input[0])
V=list(map(int, input[1].split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき

heapq.heapify(V)
a=heapq.heappop(V)
b=0
for i in range(len(V)):
    b=heapq.heappop(V)
    a=(a+b)/2

print(a)

Submission status: Runtime Error

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

sumV = vn[0]

for v in vn[1:]:
    sumV = (sumV + v)/2
print(sumV)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
v=list(map(int,input().split()))
v.sort()
if len(v)==1:
    print(v[0])
elif len(v)==2:
    print(float((v[0]+v[1])/2))
else:
    s=(float((v[0]+v[1])/2))
    for j in range(2,N):
        s=float((s+v[j])/2) 
print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
v=list(map(int,input().split()))
s=0
v.sort()
if len(v)==1:
  print(v[0])
elif len(v)==2:
  print(sum(v)/2)
else:
  s+=(v[0]+[1])/(2**N-1)
  for j in range(2,N):
    s+=v[j]/(2**N-j)
print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
v=list(map(int,input().split()))
s=0
v.sort()
if len(v)=1:
  print(v[0])
elif len(v)=2:
  print(sum(v)/2)
else:
  s+=(v[0]+[1])/(2**N-1)
  for j in range(2,N):
    s+=v[j]/(2**N-j)
print(s)

Submission status: Runtime Error

Solution code:
N=int(input())
L=list(map(int,input().split()))
LR=sorted(L,reverse=True)
ans=0
for i range(N-1):
  ans=(L[i]+L[i+1])/2
print(ans)

Submission status: Runtime Error

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

V_sorted=sorted(V)

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

print(now_value)

Submission status: Runtime Error

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

V_sorted=sorted(V)

now_value=(V_sorted[0]+V_sorted[1])/2
for i in range(2,N):
    now_value=(new_value+V_sorted[i])/2

print(now_value)

Submission status: Runtime Error

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


import heapq

heapq.heapify(V_list)


for i in range(N-1):
        v1=heapq.heappop(V_list)
        v2=heapq.heappop(V_list)
        new_v = (v1+v2)/2
        heapq.heappush(V_list,new_v)





print(V_list[0])
~

Submission status: Runtime Error

Solution code:
N = int(input())
a = map(int,input().split())
heap.heapify(a)
for i in range(N-1):
  x = heap.heappop(a)
  y = heap.heappop(a)
  z = (x+y)/2
  heap.heappush(a,z)
answer = heap.heappop(a)
print(answer)

Submission status: Runtime Error

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

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(N-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)

Submission status: Runtime Error

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

v.sorted(reverse=True)
x = 1
answer = 0
for i in range(n-1):
    x *= 2
    answer += (v[i]/x)

answer += v[N-1]/x
print(answer)

Submission status: Runtime Error

Solution code:
from heapq import heapify, heappush, heappop
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

Submission status: Runtime Error

Solution code:
from heapq import heapify, heappush
n = int(input())
L = [int(i) for i in input().split()]
heapify(L)
for i in range(n-1):
    s = (L[0]+L[1])/2
    L = L[2:] 
    heappush(L,s)
ans = heapq.heappop(L)
print(ans)

Submission status: Runtime Error

Solution code:
3
500 300 200

Submission status: Runtime Error

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

m = min(lis)
lis.remove(min(lis))
m_2 = min(lis)
lis.remove(min(lis))
v = (m + m_2) / 2   

for i in range(0, N - 1):
    v = (v + min(lis)) / 2
    lis.remove(min(lis))

print(v)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin >> n;
  int a[n];
  priority_queue<float, vector<float>, greater<float> > pq;
  for(int i = 0 ; i < n ; i ++ )
  {
    cin >> a[i];
    pq.push(a[i]);
  }
  double x,y,ans=0;
  while(pq.empty()==false)
  {
    if(pq.empty()==true){
      break;
    }
    x=pq.top();
    pq.pop();
     if(pq.empty()==true){
      break;
    }
    y=pq.top();
    pq.pop();
    ans+=(x+y)/2;
    pq.push((x+y)/2);
  }
  cout<<ans;
}

Submission status: Runtime Error

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

while (len(b) > 1):
	b = sorted(b)
    x = b.pop(0)
    y = b.pop(0)
    b.append((x+y)/2)
print(b[0])
pass

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if val:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

Submission status: Runtime Error

Solution code:
n=input()
n=int(n)
val=list(map(int,input().strip().split(' ')))
val.sort()
res=0
if len(val)>0:
    if len(val)==1:
        print(val[0]/2)
    elif len(val)==2:
        print(sun(val)/2)
    else:
        #res=(val[0]+val[1])/2
        res=(val[0]+val[1])/2
        for i in range(2,len(val)):
            res=(res+val[i])/2
            #print(res)
        print(res)
else:
    #print('error')
    pass

Submission status: Runtime Error

Solution code:
a = int(input())
l=list(map(int ,input().split()))
ll=[]
for i in range(a-2):
        k=(l[i]+l[i+1])/2+(l[i+2])
        ll.append(k/2)

print(max(ll))

Submission status: Runtime Error

Solution code:
n = int(input())
arr = list(map(int, input().split()))
while len(arr) > 1:
  arr = sorted(arr)
  v1 = arr.pop(0)
  v2 = arr.pop(0)
  arr.appned((v1 + v2) / 2)
print(arr[0])

Submission status: Runtime Error

Solution code:
n = input()
arr = list(map(int, input().split()))
while len(arr) > 1:
  arr = sorted(arr)
  v1 = arr.pop(0)
  v2 = arr.pop(0)
  arr.appned((v1 + v2) / 2)
print(arr[0])

Submission status: Runtime Error

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

v.sort()
dif=[v[i+1]-v[i] for i in range(n-1)]

while len(v)>2:
  i=dif.index(min(dif))
  v[i]=(v[i]+v.pop(i+1))/2
  dif.pop(i)
  dif[i]=v[i+1]-v[i]
  if i!=0: dif[i-1]=v[i]-v[i-1]

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

v1 = v.sort().reverse()
k = 0

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

print(k + v[n] * (2 ** ( - (n + 1)))

Submission status: Runtime Error

Solution code:
N = int(input())
v = list(map(int,input().split()))
while len(v) > 2:
  temp = []
  for i in range(len(v)//2):
    temp.append((v[2*i] + v[2*i + 1])/2)
  if n % 2 == 0:
    v = temp
  else:
    temp.append(v[-1])
    v = temp
      
print(v[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
l=[int(i) for i in input().split()]
s=0
for i in range(n-1):
	f=l[i]
    for j in range(n):
      if i!=j:
        f+=l[j]
        f=f/2
    if s<f:
      s=f
      
      

print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import heapq

n = int(raw_input())
values = map(int, raw_input().split())
values = sorted(values)
h = []
for v in values:
  heapq.heappush(h, -v)

while len(h) > 1:
  a = heapq.heappop()
  b = heapq.heappop()
  c = (a+b)/2
  heapq.heappush(h, c)
 
print -heapq.heappop()

Submission status: Runtime Error

Solution code:
import heapq

n = int(raw_input())
values = map(int, raw_input().split())
values = sorted(values)
h = []
for v in values:
  heapq.heappush(h, v)

while len(h) > 1:
  a = heapq.heappop()
  b = heapq.heappop()
  c = (a+b)/2
  heapq.heappush(h, c)
 
print heapq.heappop()

Submission status: Runtime Error

Solution code:
import heapq

n = int(raw_input())
values = map(int, raw_input().split())
values = sorted(values)
h = []
for v in values:
  heapq.heappush(h, v)

while len(h) > 0:
  a = heapq.heappop()
  b = heapq.heappop()
  c = (a+b)/2
  heapq.heappush(h, c)
 
print heapq.heappop()

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
n = int(input())
y = []

a = input().split()
for i in range(n-1):
    a.sort()
    x = fun(a[0],a[1])
    del a[0]
    del a[0]

    a.append(x)
    
print(a[0])

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

i =0
li = []

li.append(int(input().split()))

li = sort(li)

while(N>1):
  b = (li[0] + li[1])/2
  li.append(b)
  li = sort(li)
  N = N-1
  
print(li[0])

Submission status: Runtime Error

Solution code:
N = int(input())

i = 0
li = []

while True:
  a = int(input())
  li.append(a)
  i = i+1
  if i=N:
    break

li = sort(li)

while(N>1):
  b = (li[0] + li[1])/2
  li.append(b)
  li = sort(li)
  N = N-1
  
print(li[0])

Submission status: Runtime Error

Solution code:
N = int(input())

i =0
li = []

while True:
  a = int(input())
  li.append(a)
  i++
  if i=N-1:
    break

li = sort(li)

while(N>1):
  b = (li[0] + li[1])/2
  li.append(b)
  li = sort(li)
  N = N-1
  
print(li[0])

Submission status: Runtime Error

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

while cnt is not 1:
		
    titi = max(v)
    haha = min(v)

    v.remove(titi)
    v.remove(haha)

    son = (titi + haha)/2 
    
    cnt = N - 1
    
print(son)

Submission status: Runtime Error

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

for i in N:

    titi = max(v)
    haha = min(v)

    v.remove(titi)
    v.remove(haha)

    son = (titi + haha)/2 

    v.add(son)

res = v[0] 
print(str(res))

Submission status: Runtime Error

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

for i in N:

    titi = max(v)
    haha = min(v)

    v.remove(titi)
    v.remove(haha)

    son = (titi + haha)/2 

    v.add(son)

res = v[0] 
print(str(res))

Submission status: Runtime Error

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

for i in kazu:

    titi = max(int(sozai))
    haha = min(int(sozai))

    int(sozai).remove(titi)
    int(sozai).remove(haha)

    son = (titi + haha)/2 

    sozai.add(str(son))

print(str(sozai))

Submission status: Runtime Error

Solution code:
sozai = input()

while len(sozai) != 1:

    titi = max(sozai)
    haha = min(sozai)

    sozai.remove(titi)
    sozai.remove(haha)

    son = (titi + haha)/2 

    sozai.add(son)

print(str(sozai))

Submission status: Runtime Error

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

r = [v * (0.5 ** i) for i, v in enumerate(vs)]

return sum(r)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
n = int(input())
vlist = map(float, input())
vlist = sorted(vlist)
val = vlist[0]
for i in range(n-1):
  if i == n-1:
    break
  val = (val + vlist[i+1]) / 2
print(val)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np

N = int(input())
V = input().split()
V = np.array(V).astype(int)
V = np.sort(V)

U = np.array([])

for _ in range(2):
    U = np.append(U, 0.5**(N-1))
    
for i in range(2, N):
    U = np.append(U, 0.5**(N-i))

print(V @ U)

Submission status: Runtime Error

Solution code:
N = int(input())
List = [] * N
List = input().split(" ")
List.sort()
for i in range(N-1):
    List[i+1] = (int(List[i]) + int(List[i+1]) / 2
print(List[N])

Submission status: Runtime Error

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

v_sorted = sorted(v)

out = 0
for i in range(N-1):
  out += v_sorted[i]*(1/2)^(N-1-i)

print(out+v_sorted[-1]*(1/2))

Submission status: Runtime Error

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

v_sorted= sorted(v)
ans = (v_sorted[0]+v_sorted[1])/2

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

print (ans)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())

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

v = sorted(v, reverse = False)

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

pprint(sum)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

arr.sort()

prev = arr[0]

for i in range(n-1)
  prev = (prev+arr[i+1])/2
  
print(prev)

Submission status: Runtime Error

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

w = sorted(v)
ans = [] 

for i in range(1,n):
  ans.append(0)

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

print(ans[-1])

Submission status: Runtime Error

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

if N == 2:
    print(sum([int(x) for x in Vs])/N)
else:
    lists = [int(x) for x in Vs]
    while N > 1:
        lists.sort()
        x = lists.pop(0) + lists.pop(0)) / 2
        lists.insert(0, x)
        N -= 1

    print(lists[0])

Submission status: Runtime Error

Solution code:
##C problem
N = int(input())
v = list(map(float, input().split()))
##初期処理
a=min(v)
##最初に出てくる指定した要素を削除
#v.remove(a)
#v.remove(b)
#v.append( (a+b)/2 )

for i in range(N-1):
        a=v[-1]
        remove(a)
        b=min(v)
        v.remove(b)
        v.append((a+b)/2)

Submission status: Runtime Error

Solution code:
##C problem
N = int(input())
v = list(map(float, input().split()))
##初期処理
a=min(v)
##最初に出てくる指定した要素を削除
v.remove(a)
b=min(v)
v.remove(b)
v.append( (a+b)/2 )

for i in range(N-2):
        a=v[-1]
        remove(a)
        b=min(v)
        v.remove(b)
        v.append((a+b)/2)

print(v[-1])

Submission status: Runtime Error

Solution code:
N=int(input())
values=[int(input()) for i in range(N)]
values.sort()
ret=0
for i in values:
    ret=(i+ret)*0.5
print(ret)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = input()
V = list(map(int, input().split()))
V = sorted(V)
value = V.pop(-1)
while value:
    value += V.pop(-1)
print(value)

Submission status: Runtime Error

Solution code:
N = int(input())
nums = [int(i) for i in input().split()]
LOOP = int(np.log2(N))+1
LOOP_N = N

for _ in range(LOOP):
    is_odd = (LOOP_N%2 == 1)
    LOOP_N = math.ceil(LOOP_N/2)
    nums = [nums[2*i] if (i==LOOP_N-1 and is_odd) else (nums[2*i]+nums[2*i+1])/2  for i in range(LOOP_N)]

print(nums[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

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

v.sort()

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

print(value)

Submission status: Runtime Error

Solution code:
N = int(input())
y =[]
for i in range(N):
    x = int(input())
    y.append(x)
    
max1 = y[1]
max2 = y[2]
for j in y:
    if j > max1 and j > max2:  #max1が一番大きいと考える
        max1 = y[j]
    elif j > max2 and j < max1:
        max2 = y[j]
    else:
        pass

print((max1 + max2)/N)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n=int(input())
v1=map(int,input().split())
v=list(v1)
#価値の低いものから順に平均をとっていけばよい
for i in range(n):
    for j in range(i+1,n):
        if v[i]>v[j]:
            a=v[i]
            v[i]=v[j]
            v[j]=a
for l in range(n-1):
    a=(v[0]+v[1])/2
    v=a+v[2,n-l]
print(v[0])

Submission status: Runtime Error

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

v.sort()

res = v[0]

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

print(res)

Submission status: Runtime Error

Solution code:
N = int(input())
y =[]
for i in range(N):
    x = int(input())
    y.append(x)
    
max1 = y[1]
max2 = y[2]
for j in y:
    if j > max1 and j > max2:  #max1が一番大きいと考える
        max1 = y[j]
    elif j > max2 and j < max1:
        max2 = y[j]
    else:
        pass

print((max1 + max2)/N)

Submission status: Runtime Error

Solution code:
N = input()
a = sorted(list(map(int, input().split())))
b = (a[0] + a[1]) / 2
if N > 2:
  for c in a[2:]:
    b = (b + c) / 2
print(b)

Submission status: Runtime Error

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

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

print(b)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import sys
sys.setrecursionlimit(10**6)
n,q = map(int,input().split())
a=[[] for i in range(n)]
p=[]*n
l=[0]*n

def dfs(parent,current):
    for i in a[current-1]:
        if i != parent:
            l[i-1] += l[current-1]
            dfs(current,i)


for i in range(n-1):
    t1,t2 = map(int,input().split())
    a[t1-1].append(t2)
    a[t2-1].append(t1)
    
for i in range(q):
    t1,t2 = map(int,input().split())
    l[t1-1]+=t2
dfs(-1,1)

print(" ".join(map(str,l)))