TnT/Multi_CodeNet4Repair huggingface dataset:
Problem: 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.

Submission attempts (in order):
N,Q=map(int,input().split())
l=[[1,0,0]]
for i in range(1,N):
    a,b=map(int,input().split())
    l.append([b,a,0])
l.sort()
for i in range(Q):
    p,x=map(int,input().split())
    l[p-1][2]+=x
t=[l[0][2]]
for i in range(1,N):
    t.append(t[l[i][1]-1]+l[i][2])
print(*t)

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
A = list(map(int,input().split()))
A.sort()
B = (A[0] + A[1]) / 2
for i in range(N-2):
    B = (B + A[i+2]) / 2
print(int(B))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])

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

vc = sorted(v)

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

print(vc[n-1])

Verdicts: Wrong Answer

Accepted
Problem: 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.

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


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import heapq

def solve(n, v):
    q = []
    for i in range(n):
        heapq.heappush(q, v[i])
    for i in range(n-1):
        x = heapq.heappop(q)
        y = heapq.heappop(q)
        heapq.heappush(q, (x+y)/2)
        print(q)
    return heapq.heappop(q)

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

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)))

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(heapq.heappop(v_ls))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
vs = list(map(int, input().split()))

vs.sort(reverse=True)
print(vs)

if N == 2:
    print((vs[0] + vs[1]) / 2)
    exit()

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

print(x)


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

vs.sort()

if N == 2:
    print((vs[0] + vs[1]) / 2)
    exit()

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

print(x)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = float(input())
v = list(map(float, input().split()))
v.sort()
ans = float(0)
ans = v[0]+v[1]/2
if N>3:
    for i in v[2::]:
        ans = (ans+i)/2

print(ans)


N = float(input())
v = list(map(float, input().split()))
v.sort()
ans = float(0)
for i,j in enumerate(v,1):
    ans += 2*(i-2)*j
ans = (ans + 2*v[0] + v[1])/(2*(N-1))


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

print(ans)


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

print(ans)


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

print(ans)


Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
vn = list(map(int, input().split()))

def merge(x, y):
    return (x + y) / 2


for _ in range(n-1):
    x = sorted(vn).pop(0)
    y = sorted(vn).pop(0)
    vn.append(merge(x, y))

print(vn[0])

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

def merge(x, y):
    return (x + y) / 2

for _ in range(n-1):
    vn = sorted(vn)
    x = vn.pop(0)
    y = vn.pop(0)
    vn.append(merge(x, y))

print(vn[0])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())
v=list(map(int,input().split()))
v=sorted(v)

for i in range(n-1):
    a=sum(v[:2])/2
    v[0]=a
    v.pop(1)
    
print(int(v[0]))    

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

for i in range(n-1):
    a=sum(v[:2])/2
    v[0]=a
    v.pop(1)
    
print(v[0])    

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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])

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

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

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

Verdicts: Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()
v = LI()
vs = sorted(v)

def kati(x,y):
    return (x+y)/2

result = []
for i in range(2, n):
    t = kati(kati(vs[i-2], vs[i-1]), vs[i])
    result.append(t)

ans = max(result)
print(ans)

from math import floor,ceil,sqrt,factorial,log
from collections import Counter, deque
from functools import reduce
import numpy as np
def S(): return input()
def I(): return int(input())
def MS(): return map(str,input().split())
def MI(): return map(int,input().split())
def FLI(): return [int(i) for i in input().split()]
def LS(): return list(MS())
def LI(): return list(MI())
def LLS(): return [list(map(str, l.split() )) for l in input()]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def LLSN(n: int): return [LS() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]

n = I()
v = LI()
vs = sorted(v)

def kati(x,y):
    return (x+y)/2

result = vs[0]
cv = 0
for i in range(1, n):
    result = kati(result, vs[i])

print(result)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])


N=int(input())
v=[int(x) for x in input().split()]
cnt=0
while cnt<N-1:
    v.sort()
    v[0]=(v[0]+v.pop(1))/2
    cnt+=1
print(v[0])

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
a=list(map(int,input().split()))
while len(a)>=2:
	a.sort()
	x,y=map(int,list.pop())
	a.append((x+y)/2)

N=int(input())
a=list(map(int,input().split()))
while len(a)>=2:
	a.sort()
	x,y=map(int,a.pop())
	a.append((x+y)/2)

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

N=int(input())
a=list(map(int,input().split()))
for i in range(0,N):
	a.sort()
	x,y=map(int,a.pop())
	a.append((x+y)/2)

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

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

Verdicts: Runtime Error

Runtime Error

Wrong Answer

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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]

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


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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))


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

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



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


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

v.sort()

son = v[0]

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

print(son)

Verdicts: Runtime Error

Runtime Error

Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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))


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(sum)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

#!/usr/bin/env python3

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)


Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
count = int(input())
numlist = list(map(int, sorted(input().split())))
result = 0



  
  
while len(numlist) >= 2:
  sum = (numlist[1] + numlist[0]) / 2
  del numlist[0:2] 
  numlist.append(sum)
  numlist = sorted(numlist)
  print(sum)
  print(numlist)
  
print(sum)


count = int(input())
numlist = list(map(int, sorted(input().split())))
result = 0

  
for i in range(1,count):
  numlist = sorted(numlist)
  sum = (numlist[1] + numlist[0]) / 2
  del numlist[0:2] 
  numlist.append(sum)

  
print(sum)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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))

import numpy as np
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))

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
V = [int(s) for s in input().split(" ")]
V_sort = sorted(V)

sumV = 0
for i,x in enumerate(V_sort):
    p = max(0,i-1)
    sumV += x*(2**p)
    print(p,sumV)
res = sumV/2**(N-1)
print(res)

N = int(input())
V = [int(s) for s in input().split(" ")]
V_sort = sorted(V)

sumV = 0
for i,x in enumerate(V_sort):
    p = max(0,i-1)
    sumV += x*(2**p)
    #print(p,sumV)
res = sumV/2**(N-1)
print(res)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
from sys import stdin

N = int(stdin.readline())
v = list(map(int, stdin.readline().split()))

v.sort()

value = v[0]
for i in range(N-1):
    value = 0.5*(value + v[i+1])

print(int(value))

from sys import stdin

N = int(stdin.readline())
v = list(map(int, stdin.readline().split()))

v.sort()

value = v[0]
for i in range(N-1):
    value = 0.5*(value + v[i+1])

print(value)

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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

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

Verdicts: Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):


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

print(v)
print(res)




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

print(res)


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
#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;
}

#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;
}

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

Verdicts: Runtime Error

Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
li = list(map(int, input().split()))

a = 0
li.sort()
if n == 2:
    print((li[0] + li[1])/2)
elif n >=3:
    for i in range(n-2):
        a = (li[i] + li[i+1])/2
print((a+li[-1])/2)

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

li.sort()
a = li[0] 

if n >=2:
    for i in range(1,n-1):
        a = (a + li[i])/2
        
print((a+li[-1])/2)

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n = int(input())
v = list(map(int, input().split()))

v = sorted(v)

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

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

v = sorted(v)

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
# -*- coding: utf-8 -*-

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

v = sorted(v)
print(v)
a = v.pop(0)
b = v.pop(0)

result = (a + b)/2
while len(v) > 0:
    a = v.pop(0)
    print(a)
    b = result
    result = (a + b)/2

print(result)



# -*- coding: utf-8 -*-

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

v = sorted(v)
a = v.pop(0)
b = v.pop(0)

result = (a + b)/2
while len(v) > 0:
    a = v.pop(0)
    b = result
    result = (a + b)/2

print(result)



Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

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)

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)

N = int(input())
l = list(map(int,input().split()))
temp = 0
l.sort()

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

print(temp)

Verdicts: Wrong Answer

Wrong Answer

Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
import heapq
size = int(input())
li = list(map(int,input().split()))
heapq.heapify(li)
while(len(li)>1):
    a = heapq.heappop(li)
    b = heapq.heappop(li)
    heapq.heappush(li,(a+b)//2)
print(li[0])


import heapq
size = int(input())
li = list(map(int,input().split()))
heapq.heapify(li)
while(len(li)>1):
    a = heapq.heappop(li)
    b = heapq.heappop(li)
    heapq.heappush(li,(a+b)/2)
print(li[0])


Verdicts: Wrong Answer

Accepted
Problem: 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.

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


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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):

N=int(input())

A=input().split()
B=[0]*N

for i in range(len(A)):
    B[i]=int(A[i])

B.sort()
print(B)
B[0]=B[0]/(2**(N-1))

for i in range(len(B)-1):
    j=i+1
    B[j]=B[j]/(2**(N-j))

print(sum(B))


N=int(input())

A=input().split()
B=[0]*N

for i in range(len(A)):
    B[i]=int(A[i])

B.sort()
B[0]=B[0]/(2**(N-1))

for i in range(len(B)-1):
    j=i+1
    B[j]=B[j]/(2**(N-j))

print(sum(B))

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
v = list(map(int, input().split()))

for i in range(N - 1):
    print(v)
    v = sorted(v, reverse=True)
    m1 = v.pop()
    m2 = v.pop()
    v.append((m1 + m2) / 2)

print(v[0])

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

for i in range(N - 1):
    v = sorted(v, reverse=True)
    m1 = v.pop()
    m2 = v.pop()
    v.append((m1 + m2) / 2)

print(v[0])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
n=int(input())  
v=list(map(int, input().split()))
v.sort()
for i in range(n):
    if i == 0:
        s = (1/2)**(n-1) * v[0]
    else:
        s = s + (1/2)**(n-i) * v[i]
print(int(s))


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N=int(input())
v = [int(i) for i in input().split()] 
v.sort()
value=(v[0]+v[1])/2
j=0
hoge=[]
for i in range(2,N):
    value=(value+v[i])/2
print(int(value))

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
a = int(input())
n = list(map(int, input().split()))
for i in range(a-1) :
    x = s.pop()
    y = s.pop()
    s.append((x + y) / 2)
print(s[0])

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

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
# 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])

# coding: utf-8

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

Verdicts: Wrong Answer

Accepted
Problem: 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.

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

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)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])

n = int(input())
nums = sorted(map(lambda x: int(x), input().split(' ')))
res = nums[0] / 2**n
for index, num in enumerate(nums):
    res += num / 2**(n - index)
print(res)

Verdicts: Runtime Error

Accepted
Problem: 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.

Submission attempts (in order):
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])

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

for i in range(n-1):
  a, b = v[:2], v[2:]
  new = sum(a)/2
  v = [new] + b
  v.sort()
  
print(v[0])

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)


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


Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
N = int(input())
arr = input()
guzai = arr.split(" ")
guzai_int = [int(i) for i in guzai]

for i in range(1, N):
  guzai_int.sort()
  x = guzai_int.pop(0)
  y = guzai_int.pop(0)
  guzai_int.append((x+y)/2)

print(guzai_int)

N = int(input())
arr = input()
guzai = arr.split(" ")
guzai_int = [int(i) for i in guzai]

for i in range(1, N):
  guzai_int.sort()
  x = guzai_int.pop(0)
  y = guzai_int.pop(0)
  guzai_int.append((x+y)/2)

print(guzai_int.pop())

Verdicts: Wrong Answer

Accepted
Problem: 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.

Submission attempts (in order):
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)

N = int(input())
Value = list(map(int,input().split()))
Value = sorted(Value)
Sum = Value[0]
for i in Value:
    Sum = (Sum+i)/2.0
print(Sum)

Verdicts: Wrong Answer

Accepted