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:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
   res = (List[num] + List[num+1])/2
   ans.append(res)
   if num < a-2:
    resa = (ans[num] + List[num+2])/2
    num = num + 1
   else:
    break
print(resa)

Submission status: Runtime Error

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

for i in range(n-1):
	mn1 = v.remove(min(v))
    mn2 = v.remove(min(v))
    v.append((mn1 + mn2) / 2)

print(v[0])

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist, tmp)
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N - 2, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        tmp = 0
        cook(N, V, alist, tmp)
        
cook(N, V, alist, tmp)

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N - 2, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V, alist)
        
cook(N, V, alist)

Submission status: Runtime Error

Solution code:
num = int(input())
lines = input().split(" ")
int_lines = [int(i) for i in lines]
int_lines.sort()
set_lines = set(int_lines)
count = 1

if num == 2:
  result = (int(lines[0]) + int(lines[1])) / 2
  print(result)
elif len(set_lines) == 1:
  print(int(set_lines[0]))
elif len(set_lines) == 2:
  result = (int(set_lines[0]) + int(set_lines[1])) / 2
  print(result)
else:
  itr = iter([int(j) for j in list(set_lines)])
  for j in itr:
    if count == 1:
        x = j
        count += 1
    elif count == 2:
        y = j
        count += 1
    else:
        x = (x + y) / 2
        y = j
        count += 1
  x = (x + y) / 2
    
  print(x)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  try:
   res = (List[num] + List[num+1])/2
   ans.append(res)
   resa = (ans[num] + List[num+2])/2
   num = num + 1
  except:
   break
print(resa)

Submission status: Runtime Error

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  try:
   res = (List[num] + List[num+1])/2
   ans.append(res)
   resa = (ans[num] + List[num+2])/2
   num = num + 1
  except:
   print(resa)

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V, alist):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V, alist)
        
cook(N, V, alist)

Submission status: Runtime Error

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  try:
   res = (List[num] + List[num+1])/2
   ans.append(res)
   resa = (ans[num] + List[num+2])/2
   num = num + 1
  except:
   print(resa)
   break

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1:
        print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import itertools
_ = int(input())
u_list =  list(map, input().split())
s_list = []
for s in itertools.permutations(u_list):
  s = list(s)
  _sum = (s.pop(0) + s.pop(0)) / 2
  while s:
    _sum = (_sum + s.pop(0)) / 2
  s_list.append(_sum)
print(max(s_list))

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
a = int(input())
List=[int(i) for i in input().split()]
List.sort()
print(List)
num = 0
ans = []
while num < a:
  res = (List[num] + List[num+1])/2
  ans.append(res)
  resa = (ans[num] + List[num+2])/2
  print(resa)
  num = num + 1

Submission status: Runtime Error

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

vv = vs.sort()
ans = vv[0]

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

print(ans)

Submission status: Runtime Error

Solution code:
import itertools
_ = int(input())
u_list = [int(input()) for i in range(_)]
s_list = []
for s in itertools.permutations(u_list):
  s = list(s)
  _sum = (s.pop(0) + s.pop(0)) / 2
  while s:
    _sum = (_sum + s.pop(0)) / 2
  s_list.append(_sum)
print(max(s_list))

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1
    print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        V = alist
        alist = []
        cook(N, V)
        
cook(N, V)

Submission status: Runtime Error

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

import itertools
B = list(itertools.combinations(A,2))

result=[]
for b in B:
  a = A.copy()
  while len(a)>=3:
    first = (b[0]+b[1])/2
    a.remove(b[0])
    a.remove(b[1])
    a.append(first)
  result.append((a[0]+a[1])/2)
print(max(result))

Submission status: Runtime Error

Solution code:
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000.0
while True:
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
    if n==1:
        print(v[0])
        break

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
alist = []
tmp = 0

def cook(N, V):
    if N = 1
    print(V[0])
    
    else:
        V.sort()
        for i in range(0, N, 2):
            if i + 1 > N - 1:
                alist.append(V[i])
                
            else:
                tmp = (V[i] + V[i +1]) / 2
            alist.append(tmp)
            
        N = len(alist)
        cook(N, alist)
        
cook(N, V)

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N=int(input())
v=int(input()).split()
V=v.sort()
cnt=0
while cnt<N-1:
    v[0]=(int(v[0])+int(v[cnt+1]))/2
    cnt+=1
print(v[0])

Submission status: Runtime Error

Solution code:
import itertools
_ = int(input())
u_list = [int(input()) for i in range(_)]
s_list = []
for s in itertools.permutations(u_list):
  _sum = (s.pop(0) + s.pop(0)) / 2
  while s:
    _sum = (_sum + s.pop(0)) / 2
  s_list.append(_sum)
print(max(s_list))

Submission status: Runtime Error

Solution code:
import math
N = int(input())
v = list(map(int,input().split()))
s = v
v_new = 0
a = 0
k = []
p = N
for i in range(N-1):
    if v.count(v[0]) == p:
        break
    else:
       x = v[(math.ceil(len(v)/2))]
       v.remove(x)
       for j in range(len(v)):
           k.append(v[j])
       for j in range(len(k)):
           k[j] = abs(k[j]-x)
       a = k.index(min(k))
       y = v[a]
       v_new = (x+y)/2
       v.append(v_new)
       v.remove(y)
       v_new = 0
       p = p-1
print(v[0])

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <iomanip>

using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

typedef long long LL;
typedef vector<int> VI;

int main() {
  int N;
  cin >> N;
  priority_queue<double, vector<double>,  greater<double>> q;
  int v;
  for (int i = 0; i < N; i++) {
    cin >> v;
    q.push((double)v);
  }
  while (q.size() > 1) {
    double v1 = q.top();
    q.pop();
    double v2 = q.top();
    q.pop();
    q.push((v1+v2)/2);
  }
  cout << fixed << setprecision(10) << q.top() << endl;
  return 0;
}

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

temp = 0

for i in range(1,n):
    if i == 1:
        temp += decimal.Decimal((v[0] + v[1])/2)
    else:
        sum_ = decimal.Decimal((temp + v[i])/2)

print(sum_)

Submission status: Runtime Error

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

vv = vs.sort()
ans = vv[0]

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

print(ans)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <iomanip>

using namespace std;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

typedef long long LL;
typedef vector<int> VI;

int main() {
  int N;
  cin >> N;
  priority_queue<double, vector<double>,  greater<double>> q;
  int v;
  for (int i = 0; i < N; i++) {
    cin >> v;
    q.push((double)v);
  }
  while (q.size() > 1) {
    double v1 = q.top();
    q.pop();
    double v2 = q.top();
    q.pop();
    q.push((v1+v2)/2);
  }
  cout << setprecision(10) << q.top() << endl;
  return 0;
}

Submission status: Runtime Error

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

temp = 0

for i in range(1,n):
    if i == 1:
        temp += decimal.Decimal((v[0] + v[1])/2)
    else:
        print(temp, v[i])
        sum_ = decimal.Decimal((temp + v[i])/2)

print(sum_)

Submission status: Runtime Error

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

v.sort()
print(v)
#subtotal=(v[0]+v[1])/2

for i in range(n-2):
    subtotal = (subtotal+v[i+2])/2
print(subtotal)

Submission status: Runtime Error

Solution code:
ソースコード
[0]
1
N = int(input())
2
n_list = list(map(int,input().split()))
3
​
4
n_list.sort()
5
​
6
new_list = []
7
ctr = 0
8
​
9
while len(n_list) > 1:
10
  n_list[ctr] = (n_list[ctr] + n_list[ctr+1])/2
11
  n_list.pop(ctr + 1)
12
  n_list.sort
13
  
14
print(n_list[0

Submission status: Runtime Error

Solution code:
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000
for k in range(n-1):
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    v=sorted(v)
    n=len(v)
print(v[0])

Submission status: Runtime Error

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

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

Submission status: Runtime Error

Solution code:
num = int(input())
V = [int(x) for x in input().split()]
kekka = []
i = 0
while i <= len(V):
  hi = (V[i] + V[i + 1]) / 2
  kekka.append(hi)
  if hi > max(V):
    V.append(hi)
  i += 1
  
print(max(kekka))

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n):
    result += (result + sortedListV[i]) / 2
print(result)

Submission status: Runtime Error

Solution code:
// Last Change: 08/18/2019 21:25:06.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  ll N;
  cin >> N;
  vector<double> v(N);
  for (auto &&e : v) {
    cin >> e;
  }
  sort(v.begin(), v.end());
  double ans = v[0];
  for (ll i = 1; i < N; ++i) {
    ans = (ans + v[i]) / 2;
  }
  cout << ans << endl;
}

Submission status: Runtime Error

Solution code:
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result += (result + sortedListV[i]) / 2
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result += (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
l =[]
for i in range(n):
    l.append(int(input()))
l.sort()

for i in range(n-1):
    ave = (l[0] + l[1])/2
    l[0:2] = []
    l.insert(0,ave)
    
print(l[0])

Submission status: Runtime Error

Solution code:
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (2, n-1):
    result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Submission status: Runtime Error

Solution code:
n = int(input())
listV =  list(map(int,input().split()))
sortedListV = sorted(listV)
result = (sortedListV[0] + sortedListV[1]) / 2

for i range (0,3):
    result = (sortedListV[i] + sortedListV[i+1]) / 2
print(result)

Submission status: Runtime Error

Solution code:
n=int(input())
v=sorted(list(map(float,input().split())))
x=-1
y=-1
z=10000
for k in range(n-1):
    for i in range(n-1):
        if v[i+1]-v[i] < z:
            x=i+1
            y=i
            z=v[i+1]-v[i]
    v[y]=(v[x]+v[y])/2
    del(v[x])
    n=len(v)
print(v[0])

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import numpy as np
n = int(input())
v = [int(i) for i in input().split()]
v.sort()
for i in range(n): 
  v1 = v.pop(-1)
  v2 = v.pop(-1)
  v3 = (v1 + v2) / 2
  v.append(v3)
  v.sort()
print(v[0])

Submission status: Runtime Error

Solution code:
import numpy as np

def set_list(es):
    return len(list(set(es))) == 1

n = int(input())
a = [int(i) for i in input().split()]

if(len(a)==2):
    print((a[0]+a[1])/2)  
elif(len(a)!=2 and set_list(a)):
    print(a[0])
else:
  for i in range(1,n):
    idx = np.argmin(a)
    num1 = a.pop(idx)
    idx = np.argmin(a)
    num2 = a.pop(idx)
    a.append((num1+num2)/2)
	print(a[0])

Submission status: Runtime Error

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

print(ans)

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

v.sort()

mean = v[0]
for i in v:
  mean = (mean + v)/2

  
print(mean)

Submission status: Runtime Error

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

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

print(s)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

Submission status: Runtime Error

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

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

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
import decimal,math
from collections import Counter,defaultdict
from fractions import gcd
from bisect import bisect_right,bisect_left
decimal.getcontext().prec = 10
N=int(raw_input())

arr=map(int,raw_input().split())
arr=sorted(arr)
# l = float(pow(2,N-1))
ans=(arr[0]+arr[1])/l
# print ans
for i in range(1,N):
	arr[i] = (arr[i]+arr[i-1])/2.0
	# print arr
print arr[-1]

Submission status: Runtime Error

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

Submission status: Runtime Error

Solution code:
N = int(input())
hoge = input().split()
v = []
for i in range(N):
  v.append(int(hoge[i]))

_v = sorted(v, reverse=True)

gu = _v.pop(N-1)
if N == 2:
  print((_v[0]+_v[1])/2)
else:
  for i in range(N-2,-1,-1):
    gu = (gu + _v.pop(i))/2
  print(gu)

Submission status: Runtime Error

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

Submission status: Runtime Error

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

vv.sort()

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

Submission status: Runtime Error

Solution code:
def C():
    N = int(input())
    values = list(map(int, input().split()))

    values = values.sort()
    total_value = [values[i]*((1/2)**i) for i in range(N)]    
    
    print(total_value)

    
if __name__ == '__main__':
    C()

Submission status: Runtime Error

Solution code:
a=int(input())
b=map(int,input().split())
b.sort()
c=b[0]

for i in range(1,a):
  c=(c+b[i])/2
  
print(c)

Submission status: Runtime Error

Solution code:
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
v = na()
v.sort()

s = 0
for i in range(n):
    s = s * 0.5 + v[i]
    if i == 0:
        s += v[i]
print(f"{s*0.5:.14f}")

Submission status: Runtime Error

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