Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
AB = list(map(int,input().strip().split()))
A = AB[0]
B = AB[1]

tmp = A
for i in range(1,B - A + 1):
    tmp ^= (A + i)
print(tmp)


Fixed submission:
import math

AB = list(map(int,input().strip().split()))
A = AB[0]
B = AB[1]


def solve_odd(a):
    return math.floor((a + 1) / 2) % 2


def solve(a):
    if a % 2 == 1:
        return solve_odd(a)
    else:
        return solve_odd(a + 1) ^ (a + 1)


print(solve(B) ^ solve(A - 1))
Buggy python submission (verdict: Runtime Error):
S = input().strip()

T = "keyence"

count = 0
j = 0
is_last = False
for i in range(0,len(S)):
    if count == 0 and T[j] == S[i]:
        j += 1
        continue
    elif count > 0 and T[j] == S[i]:
        is_last = True
        j += 1
    elif is_last and T[j] != S[i]:
        print("NO")
        exit()
    elif T[j] != S[i]:
        count += 1

if j == len(T):
    print("YES")
else:
    print("NO")






Fixed submission:
S = input().strip()

T = "keyence"

if S.startswith(T) or S.endswith(T):
    print("YES")
    exit()

count = 0
j = 0
is_last = False
for i in range(0,len(S)):
    if j >= len(T):
        print("NO")
        exit()
    if T[j] == S[i]:
        j += 1
        continue
    elif T[j] != S[i]:
        print("YES" if S.endswith(T[j:]) else "NO")
        exit()

if j == len(T):
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
S = input()

B_num = S.count("B")
W_num = S.count("W")

B_start = W_num # 一番左のBがいていいindex

res = 0
for i in range(B_start + 1):
    if S[i] == "B":
        res += B_start - i
        B_start += 1
        while(B_start < len(S) and S[B_start] == "B"):
            B_start += 1

print(res)

Fixed submission:
S = input()

B_num = S.count("B")
W_num = S.count("W")

B_start = W_num # 一番左のBがいていいindex

res = 0
for i in range(B_start + 1):
    if i == len(S):
        break
    if S[i] == "B":
        res += B_start - i
        B_start += 1
        while(B_start < len(S) and S[B_start] == "B"):
            B_start += 1

print(res)

Buggy python submission (verdict: Time Limit Exceeded):
S = input()

res = S.count("BW")
is_keep_loop = res > 0
while(is_keep_loop):
    S = S.replace("BW","WB")
    tmp = S.count("BW")
    is_keep_loop =  tmp > 0
    res += tmp

print(res)

Fixed submission:
S = input()

B_num = S.count("B")
W_num = S.count("W")

B_start = W_num # 一番左のBがいていいindex

res = 0
for i in range(B_start + 1):
    if i == len(S):
        break
    if S[i] == "B":
        res += B_start - i
        B_start += 1
        while(B_start < len(S) and S[B_start] == "B"):
            B_start += 1

print(res)
Buggy python submission (verdict: Runtime Error):
N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        H = (points[0][2] + abs(points[0][0] - cx) + abs(points[0][1] - cy))
        if all([points[i][2] == max(H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)),0) for i in range(1,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])

Fixed submission:
N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        for p in points:
            if p[2] > 0:
                target = p
                break
        H = (target[2] + abs(target[0] - cx) + abs(target[1] - cy))
        if all([points[i][2] == max(H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)),0) for i in range(0,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])

Buggy python submission (verdict: Runtime Error):
N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        H = (points[0][2] + abs(points[0][0] - cx) + abs(points[0][1] - cy))
        if all([points[i][2] == H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)) for i in range(1,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])

Fixed submission:
N = int(input().strip())

points = []

for i in range(0,N):
    points.append(list(map(int, input().strip().split())))

for cx in range(0,101):
    for cy in range(0,101):
        for p in points:
            if p[2] > 0:
                target = p
                break
        H = (target[2] + abs(target[0] - cx) + abs(target[1] - cy))
        if all([points[i][2] == max(H - (abs(points[i][0] - cx) + abs(points[i][1] - cy)),0) for i in range(0,N)]):
            res = [cx,cy,H]
            break


print(res[0],res[1],res[2])
Buggy python submission (verdict: Runtime Error):
import functools
import math

N,X = list(map(int,input().strip().split()))
xs = list(map(int,input().strip().split()))

diffs = [abs(X - x) for x in xs]

print(functools.reduce(math.gcd,diffs))

Fixed submission:
import functools

def gcd(x,y):
    big = max(x,y)
    small = min(x,y)
    while small > 0:
        big, small = small, big % small

    return big

N,X = list(map(int,input().strip().split()))
xs = list(map(int,input().strip().split()))

diffs = [abs(X - x) for x in xs]

print(functools.reduce(gcd,diffs))
Buggy python submission (verdict: Runtime Error):
S = input()

K = int(input())

tmp = 0
index = 0
res = ""

while K > tmp:
    if S[index] == "1":
        res = "1"
    else:
        res = S[index]
        break;
    index += 1

print(res)

Fixed submission:
S = input()

K = int(input())

index = 0
res = ""

while K > index and index < len(S):
    if S[index] == "1":
        res = "1"
    else:
        res = S[index]
        break;
    index += 1

print(res)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input().strip())
ar = list(map(int,input().strip().split()))

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

koubai = 1

for i in range(0,len(ar)):
    koubai = lcm(ar[i],koubai)

res = 0
koubai -= 1
for i in range(0,len(ar)):
    res += koubai % ar[i]
print(res)

Fixed submission:
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)  # 再帰定義

def lcm(x, y):
    return (x * y) // gcd(x, y)


N = int(input().strip())
ar = list(map(int,input().strip().split()))

koubai = 1

for i in range(0,len(ar)):
    koubai = lcm(ar[i],koubai)

res = 0
koubai -= 1
for i in range(0,len(ar)):
    res += koubai % ar[i]
print(res)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = list(input().strip())

Is = [1 if s == 'W' else 0 for s in S]

res = N
for i in range(0,N):
 left = Is[:max(i - 1,0)]
 right = Is[min(i + 1,N - 1):]
 tmp = sum(left) + (len(right) - sum(right))
 res = min(tmp,res)

print(res)

Fixed submission:
N = int(input())
S = list(input().strip())

cnt = S[1:].count('E')

res = cnt
for i in range(1,N):
    if S[i] == 'E':
        cnt -= 1
    if S[i - 1] == "W":
        cnt += 1
    res = min(res,cnt)

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
K = int(input())

res = []
charGram = [[''.join(s[i:i + n]) for i in range(len(s) + 1 - n)] for n in range(1,len(s) + 1)]

for i in range(len(charGram)):
    res += charGram[i]

res = sorted(set(res))
print(res[K - 1])


Fixed submission:
s = list(input())
K = int(input())

res = []
charGram = [[''.join(s[i:i + n]) for i in range(len(s) + 1 - n)] for n in range(1,K + 1)]

for i in range(len(charGram)):
    res += charGram[i]

res = sorted(set(res))
print(res[K - 1])

Buggy python submission (verdict: Time Limit Exceeded):
s = list(input())
K = int(input())

res = []
for n in range(1,len(s) + 1):
    charGram = [''.join(s[i:i + n]) for i in range(len(s) + 1 - n)]
    res += charGram

res = sorted(set(res))
print(res[K - 1])


Fixed submission:
s = list(input())
K = int(input())

res = []
charGram = [[''.join(s[i:i + n]) for i in range(len(s) + 1 - n)] for n in range(1,K + 1)]

for i in range(len(charGram)):
    res += charGram[i]

res = sorted(set(res))
print(res[K - 1])
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

Xs = list(map(int,input().split()))
sort_xs = sorted(Xs)

for i in range(N):
    index= sort_xs.index(Xs[i])
    mid = 0
    if index < N // 2:
        mid = N // 2
    else:
        mid = N // 2 - 1

    print(sort_xs[mid])


Fixed submission:
N = int(input())

Xs = list(map(int,input().split()))
sort_xs = sorted(Xs)
l = sort_xs[N // 2 - 1]
r = sort_xs[N // 2]

for i in range(N):
    print(r if Xs[i] <= l else l)
Buggy python submission (verdict: Time Limit Exceeded):
Q = int(input().strip())

def is_prime(tar):
    #mid = int(pow(tar,0.5))
    if tar < 2:
        return False
    for div in range(2,tar):
        if tar % div == 0:
            return False
    return True


count = 0

for i in range(0,Q):
    l,r = map(int,input().strip().split())
    for i in range(l, r + 1):
        if i % 2 == 0:
            continue
        if is_prime(i) and is_prime((i + 1) // 2):
            count += 1
    print(count)
    count = 0



Fixed submission:
Q = int(input().strip())

NUMS = 100000
fs = [True] * (NUMS + 1)
cs = [0] * (NUMS + 1)

for i in range(2,NUMS):
    if fs[i]:
        for j in range(i + i, NUMS,i):
            fs[j] = False
for i in range(3,NUMS,2):
    if fs[i] and fs[int((i + 1) / 2)]:
        cs[i] += 1
for i in range(3,NUMS):
    cs[i] = cs[i] + cs[i - 1]

for i in range(0,Q):
    l,r = map(int,input().strip().split())
    print(cs[r] - cs[l - 1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
As = list(map(int,input().split()))


def dfs(A_s, index,Bss):
    if index == N:
        tmp = 1
        for b in Bss:
            tmp *= b
        return 1 if tmp % 2 == 0 else 0
    b_mi = Bss.copy()
    b_mi.append(A_s[index] - 1)

    b = Bss.copy()
    b.append(A_s[index])

    b_pl = Bss.copy()
    b_pl.append(A_s[index] + 1)
    return dfs(A_s,index + 1, b_mi) + dfs(A_s,index + 1,b) + dfs(A_s,index + 1,b_pl)


print(dfs(As,0,[]))


Fixed submission:
N = int(input())
As = list(map(int,input().split()))


def dfs(A_s, index,Bss):
    if index == N:
        tmp = 1
        for b in Bss:
            tmp *= b
        return 1 if tmp % 2 == 0 else 0
    b_mi = Bss.copy()
    b_mi.append(A_s[index] - 1)

    b = Bss.copy()
    b.append(A_s[index])

    b_pl = Bss.copy()
    b_pl.append(A_s[index] + 1)
    return dfs(A_s,index + 1, b_mi) + dfs(A_s,index + 1,b) + dfs(A_s,index + 1,b_pl)


print(dfs(As,0,[]))
Buggy python submission (verdict: Runtime Error):
x,t = map(int,input().split())

print(max(x - t),0)

Fixed submission:
x,t = map(int,input().split())
 
print(max(x - t,0))
Buggy python submission (verdict: Runtime Error):
    N = int(input())
    n = 1
    while n <= N:
        n *= 2
     
    print(n // 2)

Fixed submission:
N = int(input())
n = 1
while n <= N:
  n *= 2
     
print(n // 2)

Buggy python submission (verdict: Runtime Error):
N = int(intpu())
n = 1
while n < N:
  n *= 2
  
print(n // 2)

Fixed submission:
N = int(input())
n = 1
while n <= N:
  n *= 2
     
print(n // 2)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np
import sys

n = int(input().strip())
a_tmp = list(map(int, input().strip().split(" ")))

al = np.array(a_tmp,dtype=np.int32)
np.append(al, a_tmp)

bl = []

for a in al:
    bl.append(a)
    bl.reverse()

for b in bl:
    sys.stdout.write(str(b) + " ")

Fixed submission:
import sys

n = int(input().strip())
al = list(map(int, input().strip().split(" ")))

bl = [0] * n
diff = 1 if n % 2 == 0 else -1
mid = int(n / 2)
bl[mid] = al[0]

deps = 1
a_index = 1
while a_index < n:
    if 0 > mid - deps * diff:
        break
    bl[mid - deps * diff] = al[a_index]
    a_index += 1
    if a_index >= n:
        break

    if mid + deps * diff >= n:
        break
    bl[mid + deps * diff] = al[a_index]
    a_index += 1
    deps += 1

for b in bl:
    sys.stdout.write(str(b) + " ")
Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int,input().split())

count = 0
for x,y in [(x,y) for x in range(0,K + 1) for y in range(0,K + 1)]:
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)

Fixed submission:
import itertools
    
K, S = map(int,input().split())

count = 0
for x,y in itertools.product(range(0,K + 1),range(0,K + 1)):
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int,input().split())

count = 0
for x,y,z in [(x,y,z) for x in range(0,K + 1) for y in range(0,K + 1) for z in range(0,K + 1)]:
    if x + y + z == S:
        count += 1

print(count)

Fixed submission:
import itertools
    
K, S = map(int,input().split())

count = 0
for x,y in itertools.product(range(0,K + 1),range(0,K + 1)):
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

K, S = map(int,input().split())

count = 0
for x,y,z in itertools.product(range(0,K + 1),range(0,K + 1),range(0,K + 1)):
    if x + y + z == S:
        count += 1

print(count)

Fixed submission:
import itertools
    
K, S = map(int,input().split())

count = 0
for x,y in itertools.product(range(0,K + 1),range(0,K + 1)):
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
import itertools

K, S = map(int,input().split())

count = 0
for x in range(0,K + 1):
    for y,z in itertools.product(range(0,K + 1),range(0,K + 1)):
        if x + y + z == S:
            count += 1

print(count)

Fixed submission:
import itertools
    
K, S = map(int,input().split())

count = 0
for x,y in itertools.product(range(0,K + 1),range(0,K + 1)):
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K, S = map(int,input().split())

count = 0
for x in range(0,K + 1):
    for y in range(0,K + 1):
        for z in range(0,K + 1):
            if x + y + z == S:
                count += 1

print(count)

Fixed submission:
import itertools
    
K, S = map(int,input().split())

count = 0
for x,y in itertools.product(range(0,K + 1),range(0,K + 1)):
    z = S - x - y
    if 0 <= z <= K:
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

sortAB = sorted(AB)

ans = 0
num = M
for i in sortAB:
    a,b = i
    if num >= b:
        num -= b
        ans += a* b
    else:
        ans += i * num
        break

print(ans)

Fixed submission:
N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

sortAB = sorted(AB)

ans = 0
num = M
for i in sortAB:
    a,b = i
    if num >= b:
        num -= b
        ans += a* b
    else:
        ans += a * num
        break

print(ans)

Buggy python submission (verdict: Runtime Error):
N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

A = []
B = []
for i in AB:
    a,b = i
    A.append(a)
    B.append(b)

sortA = sorted(A)

ans = 0
num = M
for i in sortA:
    ind = A.index(i)
    k = B[ind]
    if num > k:
        num -= k
        ans += i* k
    else:
        while True:
            if K == 0:
                break
            ans += i
            k -=1
print(ans)

Fixed submission:
N,M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(N)]

sortAB = sorted(AB)

ans = 0
num = M
for i in sortAB:
    a,b = i
    if num >= b:
        num -= b
        ans += a* b
    else:
        ans += a * num
        break

print(ans)
Buggy python submission (verdict: Runtime Error):
ABCD = list(map(int, input().split()))

for i in range(1 << 3):
    total = ABCD[0]
    equation = str(ABCD[0])
    for j in range(3):
        if i & (1 << j):
            total += ABCD[j+1]
            equation += "+"
        else:
            total -= ABCD[j+1]
            equation += "-"    
        equation += str(ABCD[j+1])
    if total == 7:
        equation += "=7"
        print(equation)
        break

Fixed submission:
ABCD = input()

for i in range(1 << 3):
    total = int(ABCD[0])
    equation = ABCD[0]
    for j in range(3):
        if i & (1 << j):
            total += int(ABCD[j+1])
            equation += "+"
        else:
            total -= int(ABCD[j+1])
            equation += "-"    
        equation += ABCD[j+1]
    if total == 7:
        equation += "=7"
        print(equation)
        break

Buggy python submission (verdict: Runtime Error):
ABCD = list(map(int, input().split()))

for i in range(1 << 3):
    total = ABCD[0]
    equation = str(ABCD[0])
    for j in range(3):
        if i & (1 << j):
            total += ABCD[j+1]
            equation.append("+")
        else:
            total -= ABCD[j+1]
            equation.append("-")    
        equation.append(ABCD[j+1])
    if total == 7:
        equation.append("=7")
        print(equation)
        break

Fixed submission:
ABCD = input()

for i in range(1 << 3):
    total = int(ABCD[0])
    equation = ABCD[0]
    for j in range(3):
        if i & (1 << j):
            total += int(ABCD[j+1])
            equation += "+"
        else:
            total -= int(ABCD[j+1])
            equation += "-"    
        equation += ABCD[j+1]
    if total == 7:
        equation += "=7"
        print(equation)
        break
Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
for i in range(1 << (len(S)-1)):
    eq = S
    for j in range(len(S)-1):
        if i & (1 << j):
            eq = eq[:j+1] + "," + eq[j+1:]
        else:
            pass
    eq = eq.split(",")
    eq = list(map(int,eq))
    ans += sum(eq)
print(ans)

Fixed submission:
S = input()
ans = 0
for i in range(1 << (len(S)-1)):
    eq = S
    k = 0
    for j in range(len(S)-1):
        if i & (1 << j):
            eq = eq[:j+1+k] + "," + eq[j+1+k:]
            k +=1
        else:
            pass
    eq = eq.split(",")
    eq = list(map(int,eq))
    ans += sum(eq)
print(ans)

Buggy python submission (verdict: Runtime Error):
S = input()
ans = 0
for i in range(1 << (len(S)-1)):
    eq = S
    for j in range(len(S)-1):
        if i & (1 << j):
            eq = eq[:j+1] + "," + eq[j+1:]
        else:
            pass
    eq = eq.split(",")
    ans += sum(eq)
print(ans)

Fixed submission:
S = input()
ans = 0
for i in range(1 << (len(S)-1)):
    eq = S
    k = 0
    for j in range(len(S)-1):
        if i & (1 << j):
            eq = eq[:j+1+k] + "," + eq[j+1+k:]
            k +=1
        else:
            pass
    eq = eq.split(",")
    eq = list(map(int,eq))
    ans += sum(eq)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    if not mozi in lis:
        lis[i] = mozi
        count += 1
print(count)

Fixed submission:
n = int(input())
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    lis[i] = mozi
print(len(set(lis)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = []
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    if not mozi in lis:
        lis[i] = mozi
        count += 1
print(count)

Fixed submission:
n = int(input())
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    lis[i] = mozi
print(len(set(lis)))

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
lis = []
count = 0
for _ in range(n):
    mozi = input()
    if not mozi in lis:
        lis.append(mozi)
        count += 1
print(len(lis))

Fixed submission:
n = int(input())
count = 0
lis = [None]*n
for i in range(n):
    mozi = input()
    lis[i] = mozi
print(len(set(lis)))

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = [input() for i in range(N)]
return len(set(S))

Fixed submission:
N = int(input())
S = [input() for i in range(N)]
print(len(set(S)))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
q = int(input())
ans = s

flag = False
for i in range(1, q+1):
    a = input().split()
    if len(a) == 1:
        flag = not flag
    else:
        _, f, c = a
        if (f == "1" and flag == False) or (f == "2" and flag == True):
            ans = c + ans
        elif (f == "1" and flag == True) or (f == "2" and flag == False):
            ans = ans + c
        else:
            print("fac")
            exit(1)

if flag:
    print(ans[::-1])
else:
    print(ans)




Fixed submission:
from collections import deque

s = input()
q = int(input())
ans = deque(s)

flag = False

for i in range(1, q+1):
    a = input().split()
    if len(a) == 1:
        flag = not flag
    else:
        _, f, c = a
        if (f == "1" and flag == False) or (f == "2" and flag == True):
            ans.extendleft(c)
        elif (f == "1" and flag == True) or (f == "2" and flag == False):
            ans.extend(c)
        else:
            print("fac")
            exit(1)

if flag:
    print("".join(list(ans)[::-1]))
else:
    print("".join(ans))
Buggy python submission (verdict: Time Limit Exceeded):
import math

x = int(input())
 
ans = x
 
while True:
  for i in range(2, int(math.sqrt(ans))):
    if ans % i == 0:
      continue
  else:
    print(ans)
  ans += 1

Fixed submission:
import math

x = int(input())
 
ans = x
 
while True:
  for i in range(2, int(math.sqrt(ans))):
    if ans % i == 0:
      break
  else:
    print(ans)
    exit()
  ans += 1

Buggy python submission (verdict: Time Limit Exceeded):
x = int(input())

ans = x

while True:
  for i in range(2, ans):
    if ans % i == 0:
      continue
  else:
    print(ans)
  ans += 1

Fixed submission:
import math

x = int(input())
 
ans = x
 
while True:
  for i in range(2, int(math.sqrt(ans))):
    if ans % i == 0:
      break
  else:
    print(ans)
    exit()
  ans += 1
Buggy python submission (verdict: Runtime Error):
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)

Fixed submission:
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)

Buggy python submission (verdict: Runtime Error):
n = int(input())
vv = list(map(int, input().split(' ')))

vv.sort()

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

Fixed submission:
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)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' ')
if a % 2 == 0 or b % 2 == 0:
    print('Even')
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split(' '))
if a % 2 == 0 or b % 2 == 0:
    print("Even")
else:
    print("Odd")