Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())

Amin = A/0.08
Amax = (A+1)/0.08
Bmin = B/0.1
Bmax = (B+1)/0.1


if Amax <= Bmin or Amin > Bmax:
    kai = -1
if Bmin <= Amin and Bmax > Amin:
    kai = Amin
if Amin <= Bmin and Bmax < Amin:
    kai = Bmin

print(kai)

Fixed submission:
import math
A, B = map(int,input().split())

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1


if two <= three or one > four:
    kai = -1
if three <= one and four > one:
    kai = one
if one <= three and four < two:
    kai = three

print(kai)

Fixed submission:
import math
A, B = map(int,input().split())

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1


if two <= three or one >= four:
    kai = -1
if three <= one and four > one:
    kai = one
if one <= three and four <= two:
    kai = three

print(kai)
    

Fixed submission:
import math
A, B = map(int,input().split())

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)

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

one = A/0.08
two = (A+1)/0.08
three = B/0.1
four = (B+1)/0.1

print(one, two, three, four)


if two < three or one > four:
    kai = -1
if three <= one and four >= one:
    kai = one
if one < three and four <= two:
    kai = three

print(kai)
    

Fixed submission:
import math
A, B = map(int,input().split())

count = 0

for n in range(10000):
    za = n*0.08
    zb = n*0.1
    count += 1
    if A == math.floor(za) and B == math.floor(zb):
        print(n)
        break


if count == 10000:
    print(-1)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

add = []

for p in range(99999):
    psum = 0
    for i in range(N):
        power = (X[i] - p)**2
        psum = psum + power
        i = i + 1
    add.append(psum)
    
print(min(add))

Fixed submission:
N = int(input())

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

add = []

for p in range(1000):
    psum = 0
    for i in range(N):
        power = (X[i] - p)**2
        psum = psum + power
        i = i + 1
    add.append(psum)
    
print(min(add))
Buggy python submission (verdict: Runtime Error):
N,K=map(int, input().split()) 
min = abs(N-K)
if N < K:
    if min < abs(min-K):
        print(min)
    else:
        print(abs(min-K))
else: 
    while min >= abs(min-K):
        min = abs(min-K)
        if min < K:
            if min < abs(min-K):
                print(min)
                break
            else:
                print(abs(min-K))
                break
    else :
        print(min)

Fixed submission:
X,Y,Z=map(int, input().split()) 
X,Y = Y,X
X,Z = Z,X
print(X,Y,Z)
Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
rest = N-A-B
if A ==0:
    print(0)
elif N>A+B:
    answer = A + rest
    print(answer)
elif A<=N<=A+B:
    print(A)
elif A>=N:
    print(N)

Fixed submission:
S =list(input())
if S[0] =="B" and S[1]=="B" and S[2]=="B":
    print("No")
elif S[0] =="A" and S[1]=="A" and S[2]=="A":
    print("No")
else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
N,A,B=map(int,input().split())
rest = N-A-B
if A ==0:
    print(0)
elif N>A+B:
    answer = A + rest
    print(answer)
elif A<=N<=A+B:
    print(A)

Fixed submission:
S =list(input())
if S[0] =="B" and S[1]=="B" and S[2]=="B":
    print("No")
elif S[0] =="A" and S[1]=="A" and S[2]=="A":
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n=int(input())
print((a)+(a*a)+(a**3))

Fixed submission:
a=int(input())
print((a)+(a*a)+(a**3))
Buggy python submission (verdict: Runtime Error):
s=str(input())
if(s=="ABC"):
  print("ARC")
 else:
  print("ABC")

Fixed submission:
s=str(input())
if(s=="ABC"):
  print("ARC")
else:
  print("ABC")
Buggy python submission (verdict: Time Limit Exceeded):
t=int(input())
l=[]
ct=0
for k in range(t):
    s=str(input())
    if(s not in l):
        l.append(s)
        ct+=1
print(ct)

Fixed submission:
t=int(input())
l=[]
for k in range(t):
    s=str(input())
    l.append(s)
l= list(dict.fromkeys(l))
print(len(l))
Buggy python submission (verdict: Runtime Error):
l=0
for i range (2):
  l=l+int(input())
print(6-l)

Fixed submission:
a=0
for i in range(2):
  a=a+int(input())
print(int(6-a))

Buggy python submission (verdict: Runtime Error):
l=0
l=l+int(input)
l=l+int(input)
print(6-l)


Fixed submission:
a=0
for i in range(2):
  a=a+int(input())
print(int(6-a))

Buggy python submission (verdict: Runtime Error):
l=0
for i in range(2):
    l=l+int(input)
print(6-l)

Fixed submission:
a=0
for i in range(2):
  a=a+int(input())
print(int(6-a))
Buggy python submission (verdict: Runtime Error):
l1=list(map(int,input().split()))
l2=list(map(int,input().split()))
w=len(l1)
all=0
for i in range(0,w):
    if (l1[i]==l2[i]):
        all=all+1
print(all)

Fixed submission:
l1=list(input())
l2=list(input())
w=len(l1)
all=0
for i in range(0,w):
    if (l1[i]==l2[i]):
        all=all+1
print(all)
Buggy python submission (verdict: Runtime Error):
a,b=input().split()
k=(a+b)/2
g=int(k)
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

Fixed submission:
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
k=(a+b)/2
g=int(k)
if(k==g):
    print(g)
else:
    print("IMPOSSIBLE")

Buggy python submission (verdict: Runtime Error):
a,b=input().split()
k=(a+b)/2
g=(a+b)//2
if(k==g):
    print(k)
else:
    print("IMPOSSIBLE")

Fixed submission:
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
k=(a+b)/2
g=int(k)
if(k==g):
    print(g)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
c=(2*b)+1
u=int(a/c)
if(a%c==0):
  print(u)
else():
  print(u+1)

Fixed submission:
l=list(map(int,input().rstrip().split()))
a=l[0]
b=l[1]
c=(2*b)+1
u=int(a/c)
if(a%c==0):
  print(u)
else:
  print(u+1)
Buggy python submission (verdict: Runtime Error):
l=[]
t=int(input())
b=0
c=0
for i in range(t):
    a=int(input())
    if(a>b):
        b=a
    else if(b>a and a>c):
        c=a
    l.append(a)
for i in range(0,t):
    if(l[i]!=b):
        print(b)
    else:
        print(c)

Fixed submission:
t=int(input())
l=[]
b=0
c=0
for j in range(t):
    a=int(input())
    l.append(a)
    if(a>b):
        b=a
    elif(a>c):
        c=a
for i in l:
    if(i!=b):
        print(b)
    else:
        print(c)

Buggy python submission (verdict: Runtime Error):
l=[]
t=int(input())
b=0
c=0
for i in range(t):
    a=int(input())
    if(a>b):
        b=a
    else if(b>a and a>c):
            c=a
    l.append(a)
for i in range(0,t):
    if(l[i]!=b):
        print(b)
    else:
        print(c)


Fixed submission:
t=int(input())
l=[]
b=0
c=0
for j in range(t):
    a=int(input())
    l.append(a)
    if(a>b):
        b=a
    elif(a>c):
        c=a
for i in l:
    if(i!=b):
        print(b)
    else:
        print(c)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()
ratio = []
cnt = 0

for k in range(len(s) - len(t)):
    for i in range(len(t)):
        if s[i + k] == t[i]:
            cnt += 1
    ratio.append(cnt)
    cnt = 0
res = len(t) - max(ratio)
print(res)

Fixed submission:
s = input()
t = input()
ratio = []
cnt = 0
if len(s) == len(t):
    for i in range(len(t)):
        if s[i] == t[i]:
            cnt += 1
    ratio.append(cnt)
else:
    for k in range(len(s) - len(t)):
        for i in range(len(t)):
            if s[i + k] == t[i]:
                cnt += 1
        ratio.append(cnt)
        cnt = 0
res = len(t) - max(ratio)
print(res)
Buggy python submission (verdict: Runtime Error):
N,X,T = map(int,input().split())
kaisuu = N//12
if kaisuu*X < N:
    zikan = kaisuu+zikan
else:
    zikan = kaisuu
print(zikan)

Fixed submission:
N,X,T = map(int,input().split())
kaisuu = N//X
if kaisuu*X < N:
    zikan = (kaisuu+1)*T
else:
    zikan = kaisuu*T
print(zikan)
Buggy python submission (verdict: Runtime Error):
    K = int(input())
    S = input()
    print(S[:K]+'...')

Fixed submission:
K = int(input())
S = input()
if len(S) > K:
  print(S[:K]+'...')
else:
  print(S)
Buggy python submission (verdict: Runtime Error):
N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys,reversed = True)
if K >= len(enemys):
  print(0)
else:
  enemys = enemys[K+1:]
  print(sum(enemys))

Fixed submission:
N,K = map(int,input().split())
enemys = list(map(int,input().split()))
enemys = sorted(enemys,reverse = True)
if K >= N:
  print(0)
elif K == 0:
  print(sum(enemys))
else:  
  enemys = enemys[K:]
  print(sum(enemys))
Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
time=int(int(c)/int(a))
print(int(time*b))

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
time=int(c/a)

p=time*b
print(p)

Buggy python submission (verdict: Runtime Error):
a,b,c=input().split()
time = (c+0.5)/a
print (time*b)

Fixed submission:
a,b,c=input().split()
a=int(a)
b=int(b)
c=int(c)
time=int(c/a)

p=time*b
print(p)
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

A,B,M = map(int,input().split())
a = input().split()
b = input().split()

num = 100000

for _ in range(M):
    m1,m2,m3 = map(int,input().split())
    for q in range(A):
        for w in range(B):
            res = int(a[q])+int(b[w])
            if q+1 == m1 and w+1 == m2: res-=m3
            num = min(num,res)
print(num)

Fixed submission:
import numpy as np

A,B,M = map(int,input().split())
a = input().split()
b = input().split()

num = int(min(a)) + int(min(b))

for _ in range(M):
    m1,m2,m3 = map(int,input().split())
    res = int(a[m1-1])+int(b[m2-1]) - m3
    num = min(num,res)

print(num)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Your code here!
n,a,b = map(int,input().split())
c = a+b

count = int(n/c)*a+min(n%c,a)

print(count)# coding: utf-8
# Your code here!
n,a,b = map(int,input().split())
c = a+b

count = int(n/c)*a+min(n%c,a)

print(count)

Fixed submission:
# coding: utf-8
# Your code here!
n,a,b = map(int,input().split())
c = a+b

count = int(n/c)*a+min(n%c,a)

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
# coding: utf-8
# Your code here!

n,a,b = input().rstrip().split(' ')

n = int(n)
a = int(a)
b = int(b)

x =  [a,b]
count = 0
ti = 1

for d in range(1,n+1):
    if d in x:
        ti = (ti*(n-d+1))/d
        continue
        
    ti = (int((ti*(n-d+1))/d))%(10**9+7)
    #print(ti)
   
    count +=  ti
    count = count%(10**9+7)
   
count = count%(10**9+7)
print(count)

Fixed submission:
# coding: utf-8
# Your code here!
mo = 10**9+7

def C(n,a):
  d = 1
  u = 1
  for i in range(n-a+1,n+1):
    d *= i
    d %= mo
  for j in range(1,a+1):
    u *= j
    u %= mo
  return d*(pow(u,mo-2,mo))

n,a,b = map(int,input().split())
p = pow(2,n,mo) - 1

print((p-C(n,a)-C(n,b))%mo)
Buggy python submission (verdict: Runtime Error):
s = input()
t = input()

counters = []
for i in range(len(s) - len(t)):
  part_of_s = s[i: i + len(t)]
  counter = 0
  for sss, ttt in zip(part_of_s, t):
    if sss != ttt:
      counter += 1
  counters.append(counter)
print(min(counters))

Fixed submission:
s = input()
t = input()

counters = []
for i in range(len(s) - len(t) + 1):
  part_of_s = s[i: i + len(t)]
  counter = 0
  for sss, ttt in zip(part_of_s, t):
    if sss != ttt:
      counter += 1
  counters.append(counter)
print(min(counters))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
aaa = list(map(int, input().split()))

result = 0
for i in range(n - 1):
  for j in range(i + 1, n):
    result += aaa[i] * aaa[j]
    
mode = 10 ** 9 + 7
print(result % mode)

Fixed submission:
n = int(input())
aaa = list(map(int, input().split()))

sum_a = 0
sum_aa = 0
for a in aaa:
  sum_a += a
  sum_aa += a ** 2
  
print(((sum_a ** 2 - sum_aa) // 2) % (10 ** 9 + 7))
Buggy python submission (verdict: Runtime Error):
n = int(input())
    
ac = 0
wa = 0
tle = 0
re = 0

for _ in range(n):
  s = input()
  if s = 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  else:
    re += re
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))

Fixed submission:
n = int(input())
    
ac = 0
wa = 0
tle = 0
re = 0
 
for _ in range(n):
  s = input()
  if s == 'AC':
    ac += 1
  elif s == 'WA':
    wa += 1
  elif s == 'TLE':
    tle += 1
  else:
    re += 1
    
print('AC x {}'.format(ac))
print('WA x {}'.format(wa))
print('TLE x {}'.format(tle))
print('RE x {}'.format(re))
Buggy python submission (verdict: Runtime Error):
n = int(input)
s = input()

print(len(s.split('ABC')) - 1)

Fixed submission:
n = int(input())
s = input()
 
print(len(s.split('ABC')) - 1)
Buggy python submission (verdict: Runtime Error):
s,t = input()

print(s + t)

Fixed submission:
s, t = input().split()
print(t + s)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split())
 
for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    break
 
print('{} {}'.format(a, b))

Fixed submission:
a, b, k = map(int, input().split())
 
if a > k:
  print('{} {}'.format(a - k, b))
elif a + b > k:
  print('0 {}'.format(a + b - k))
else:
  print('0 0')

Buggy python submission (verdict: Runtime Error):
a, b, k = map(int, input().split())

for i in range(k):
  if a > 0:
    a -= 1
  elif b > 0:
    b -= 1
  else:
    beak

print('{} {}'.format(a, b))

Fixed submission:
a, b, k = map(int, input().split())
 
if a > k:
  print('{} {}'.format(a - k, b))
elif a + b > k:
  print('0 {}'.format(a + b - k))
else:
  print('0 0')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
aaa = list(map(int, input().split()))

check_num = 1
delete_num = 0
while len(aaa) > 0:
  tmp_num = aaa.pop(0)
  if tmp_num == check_num:
    check_num += 1
  else:
    delete_num += 1
    
if delete_num == n:
  print(-1)
else:
  print(delete_num)

Fixed submission:
n = int(input())

check_num = 1
delete_num = 0
for i in input().split():
  i = int(i)
  if i == check_num:
    check_num += 1
  else:
    delete_num += 1

if delete_num == n:
  print(-1)
else:
  print(delete_num)
Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal
 
n = int(input())
 
if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(Decimal(str(i)) * Decimal("1.08")+0.000001) == n:
      print(i)
      break
  else:
    print(':(')

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
from decimal import Decimal
 
n = int(input())
 
if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(Decimal(str(i)) * Decimal("1.08")) == n:
      print(i)
      break
  else:
    while True:
      pass

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math
from decimal import Decimal
 
n = int(input())
 
if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(Decimal(str(i)) * Decimal("1.08")) == n:
      print(i)
      break
  else:
    while True:
	  pass

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
  if len(answers) == 0:
    print(':(')
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
import math
 
n = int(input())
answers = []

if n == 0:
  print(':(')
else:
  for i in range(1, n):
    if math.floor(i * 1.08) == n:
      answers.append(i)
      break
  else:
    print(':(')
  
  if len(answers) == 1:
    print(answers[0])
  else:
    print(answers[len(answers) // 2])

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
n = int(input())

for i in range(0.9*n//1, n):
  if (i * 1.08) // 1 == n:
    print(i)
    break
else:
  print(':(')

Fixed submission:
n = int(input())
 
ans = -1
for i in range(1, n+1):
  if int(i  * 1.08) == n:
    ans = i
if ans == -1:
  print(':(')
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
 input()
 
if s == 'SUN':
  print(0)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
else:
  pass

Fixed submission:
s = input()
 
if s == 'SUN':
  print(7)
elif s == 'MON':
  print(6)
elif s == 'TUE':
  print(5)
elif s == 'WED':
  print(4)
elif s == 'THU':
  print(3)
elif s == 'FRI':
  print(2)
elif s == 'SAT':
  print(1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
aaa = map(int, input().split())

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diff = 200000 * 2020202020
for l in lengths:
  if abs(l - (length - l)) < diff:
    diff = abs(l - (length - l))
  else:
    break
    
print(diff)

Fixed submission:
x, y = map(int, input().split())

score = 0

for z in [x, y]:
  if z == 1:
    score += 300000
  elif z == 2:
    score += 200000
  elif z == 3:
    score += 100000

if (x == 1) and (y == 1):
  score += 400000
  
print(score)
Buggy python submission (verdict: Runtime Error):
n = int(input())
aaa = map(int, input().split())

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diff = 200000 * 2020202020
for l in lengths:
  if abs(l - (length - l)) < diff:
    diff = abs(l - (length - l))
  else:
    break
    
print(diff)020202020

Fixed submission:
n = int(input())
aaa = map(int, input().split())

length = 0
lengths = []
for a in aaa:
  length += a
  lengths.append(length)
  
diffs = []
for l in lengths:
  diff = abs(l - (length - l))
  diffs.append(diff)
    
print(min(diffs))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = int(input())

s_length = len(s)

if s[: s_length // 2] == s[s_length // 2]:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
s = input()

s_length = len(s)

if s[: s_length // 2] == s[s_length // 2:]:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
l_list = list(map(int, input().split()))

score = 0
for i in range(n - 2):
  for j in range(i + 1, n - 1):
    for k in range(j + 1, n):
      a = l_list[i]
      b = l_list[j]
      c = l_list[k]
      if (a + b > c) and (b + c > a) and (c + a > b):
        score += 1
        
print(score)

Fixed submission:
import bisect

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

score = 0
#a_before = 0
#b_before = 0
for i in range(0, n - 2):
  a = l_list[i]
  #if a_before == a:
  #  continue
  #a_before = a
  
  for j in range(i + 1, n - 1):
    b = l_list[j]
    #if b_before == b:
    #  continue
    #b_before = b
    
    #minimum = b - a
    maximum = a + b
    
    #idx_minimum = bisect.bisect_right(l_list, minimum)
    idx_maximum = bisect.bisect_left(l_list, maximum)
    
    score += max(0, idx_maximum - j - 1)
        
print(score)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import sys
input = sys.stdin.readline

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

for i in range(m):
  a = aaa.pop() // 2
  insert_index = bisect.bisect_right(aaa, a)
  aaa.insert(insert_index, a)
  
print(sum(aaa))

Fixed submission:
import heapq

n, m = map(int, input().split())
aaa = [-1 * int(a) for a in input().split()]
heapq.heapify(aaa)

for i in range(m):
  a = -heapq.heappop(aaa) // 2
  heapq.heappush(aaa, -a)
  
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import sys
input = sys.stdin.readline

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

for i in range(m):
  a = aaa.pop(-1) // 2
  insert_index = bisect.bisect_right(aaa, a)
  aaa.insert(insert_index, a)
  if a == 0:
    print(0)
    break
else:
  print(sum(aaa))

Fixed submission:
import heapq

n, m = map(int, input().split())
aaa = [-1 * int(a) for a in input().split()]
heapq.heapify(aaa)

for i in range(m):
  a = -heapq.heappop(aaa) // 2
  heapq.heappush(aaa, -a)
  
print(-sum(aaa))

Buggy python submission (verdict: Time Limit Exceeded):
import bisect
import sys
input = sys.stdin.readline

n, m = map(int, input().split())
#aaa = list(map(int, input().split()))
aaa = [int(a) for a in input().split()]
aaa.sort()

for i in range(m):
  a = aaa.pop(-1) // 2
  insert_index = bisect.bisect_right(aaa, a)
  aaa.insert(insert_index, a)
  
print(sum(aaa))

Fixed submission:
import heapq

n, m = map(int, input().split())
aaa = [-1 * int(a) for a in input().split()]
heapq.heapify(aaa)

for i in range(m):
  a = -heapq.heappop(aaa) // 2
  heapq.heappush(aaa, -a)
  
print(-sum(aaa))

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

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

for i in range(m):
  a = aaa.pop(-1) // 2
  insert_index = bisect.bisect_right(aaa, a)
  aaa.insert(insert_index, a)
  
print(sum(aaa))

Fixed submission:
import heapq

n, m = map(int, input().split())
aaa = [-1 * int(a) for a in input().split()]
heapq.heapify(aaa)

for i in range(m):
  a = -heapq.heappop(aaa) // 2
  heapq.heappush(aaa, -a)
  
print(-sum(aaa))

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

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

for i in range(m):
  a = aaa.pop(-1)
  a = a // 2
  insert_index = bisect.bisect_left(aaa, a)
  aaa.insert(insert_index, a)
  
print(sum(aaa))

Fixed submission:
import heapq

n, m = map(int, input().split())
aaa = [-1 * int(a) for a in input().split()]
heapq.heapify(aaa)

for i in range(m):
  a = -heapq.heappop(aaa) // 2
  heapq.heappush(aaa, -a)
  
print(-sum(aaa))
Buggy python submission (verdict: Runtime Error):
denominator = 0
for a in range(map(int, input().split())):
  denominator += 1 / a

print(1 / denominator)

Fixed submission:
n = int(input())

denominator = 0
for a in map(int, input().split()):
  denominator += 1 / a

print(1 / denominator)