Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
  break
elif A==B:
  print(A+B)
  break
else:
  print(2*B-1)

Fixed submission:
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*B-1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
  break
elif A==B:
  print(A+B)
  break
else:
  print(2*B-1)
  break

Fixed submission:
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*B-1)

Buggy python submission (verdict: Runtime Error):
A,B=map(int, input().split())
if A-B>=2:
  print(2*A-1)
elif A=B:
  print(A+B)
else:
  print(2*B-1)

Fixed submission:
A,B=map(int, input().split())
if A-B>=1:
  print(2*A-1)
elif A==B:
  print(A+B)
else:
  print(2*B-1)
Buggy python submission (verdict: Runtime Error):
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A;
    print(T)
elif b==C;
    print(G)
elif b==G;
    print(C)
elif b==T;
    print(A)

Fixed submission:
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A:
    print(T)
elif b==C:
    print(G)
elif b==G:
    print(C)
elif b==T:
    print(A)

Buggy python submission (verdict: Runtime Error):
b = input()
A=A
T=T
C=C
G=G
if b==A;
    print('T')
elif b==C;
    print('G')
elif b==G;
    print('C')
elif b==T;
    print('A')

Fixed submission:
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A:
    print(T)
elif b==C:
    print(G)
elif b==G:
    print(C)
elif b==T:
    print(A)

Buggy python submission (verdict: Runtime Error):
b = input()
if b=='A';
    print('T')
elif b=='C';
    print('G')
elif b=='G';
    print('C')
elif b=='T';
    print('A')

Fixed submission:
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A:
    print(T)
elif b==C:
    print(G)
elif b==G:
    print(C)
elif b==T:
    print(A)

Buggy python submission (verdict: Runtime Error):
b = input()
if b==A;
    print('T')
elif b==C;
    print('G')
elif b==G;
    print('C')
elif b==T;
    print('A')

Fixed submission:
b = input()
A='A'
T='T'
C='C'
G='G'
if b==A:
    print(T)
elif b==C:
    print(G)
elif b==G:
    print(C)
elif b==T:
    print(A)
Buggy python submission (verdict: Runtime Error):
AB,BC = map(int, input().split())
print(AB*BC/2)

Fixed submission:
AB,BC,CA = map(int, input().split())
print(AB*BC//2)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b=[int(input()) for i in range(2)]
c=b[0]+b[1]
if a == 1:
  print('Hello World')
else:
  print(c)

Fixed submission:
a = int(input())
if a == 1:
  print('Hello World')
else:
  b=[int(input()) for i in range(2)]
  c=b[0]+b[1]


  print(c)

Buggy python submission (verdict: Runtime Error):
a = int(input())
list=[int(input()) for i in range(2)]
if a == 1:
  print(Hello World)
else:
  print(list[0]+list[1])

Fixed submission:
a = int(input())
if a == 1:
  print('Hello World')
else:
  b=[int(input()) for i in range(2)]
  c=b[0]+b[1]


  print(c)

Buggy python submission (verdict: Runtime Error):
a = int(input())
if a == 1:
  print(Hello World)
else:
  list=[int(input()) for i in range(2)]
  print(list[0]+list[1])

Fixed submission:
a = int(input())
if a == 1:
  print('Hello World')
else:
  b=[int(input()) for i in range(2)]
  c=b[0]+b[1]


  print(c)

Buggy python submission (verdict: Runtime Error):
a = int(input())
if a == 1:
  print(Hello World)
else:
  list=[input() for i in range(2)]
  print(list[0]+list[1])

Fixed submission:
a = int(input())
if a == 1:
  print('Hello World')
else:
  b=[int(input()) for i in range(2)]
  c=b[0]+b[1]


  print(c)
Buggy python submission (verdict: Runtime Error):
A,B=map(int(input()))
if A==2 or B==2:
  print('No')
else:
  print('Yes')

Fixed submission:
A,B=map(int, input().split())
if A==2 or B==2:
  print('No')
else:
  print('Yes')

Buggy python submission (verdict: Runtime Error):
A,B=map(int.input())
if A==2 or B==2:
  print('No')
else:
  print('Yes')

Fixed submission:
A,B=map(int, input().split())
if A==2 or B==2:
  print('No')
else:
  print('Yes')
Buggy python submission (verdict: Runtime Error):
K=int(input())
if K%2==0
  A=K*K//4
  print(A)
else:
  B=(K-1)*K//4
  print(B)

Fixed submission:
K=int(input())
if K%2==0:
  A=K*K//4
  print(A)
else:
  B=(K-1)*(K+1)//4
  print(B)

Buggy python submission (verdict: Runtime Error):
K=int.input()
if K%2==0
  A=K*K//4
  print(A)
else:
  B=(K-1)*K//4
  print(B)

Fixed submission:
K=int(input())
if K%2==0:
  A=K*K//4
  print(A)
else:
  B=(K-1)*(K+1)//4
  print(B)
Buggy python submission (verdict: Runtime Error):
S= int(input())
A=S.count('+')
B=S.count('-')
print(A-B)

Fixed submission:
S= input()
A=S.count('+')
B=S.count('-')
print(A-B)

Buggy python submission (verdict: Runtime Error):
S= int(input())
A=S.count('+')
B=S.count('-')*(-1)
print(A+B)

Fixed submission:
S= input()
A=S.count('+')
B=S.count('-')
print(A-B)
Buggy python submission (verdict: Runtime Error):
A,B= map(int, input().split())
if A<=8 and B<=8:
    print(Yay!)
else:
    print(:()

Fixed submission:
A,B= map(int, input().split())
if A<=8 and B<=8:
    print('Yay!')
else:
    print(':(')

Buggy python submission (verdict: Runtime Error):
A,B= map(int, input().split())
if A<=8 and B<=8;
    print('Yay!')
else:
    print(':(')

Fixed submission:
A,B= map(int, input().split())
if A<=8 and B<=8:
    print('Yay!')
else:
    print(':(')
Buggy python submission (verdict: Runtime Error):
A,op,B=input().strip().split()
if op == '+':
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=input().strip().split()
if op=='+':
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=input().split()
if op=='+':
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=list(map(input().split()))
if op=='+':
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op=='+':
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op=='+:'
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))

Buggy python submission (verdict: Runtime Error):
A,op,B=list(map(int, input().split()))
if op==+:
  print(A+B)
else:
  print(A-B)

Fixed submission:
A,op,B=input().strip().split()
if op == '+':
  print(int(A)+int(B))
else:
  print(int(A)-int(B))
Buggy python submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * J:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Fixed submission:
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * j:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Buggy python submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
for i in range(1,100,1):
  flag = False
  for j in range(1,100,1):
    if input_num == i * J:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Fixed submission:
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * j:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")

Buggy python submission (verdict: Runtime Error):
input_num = input()
input_num = int(input_num)
ans_flag = False;
for i in range(1,100,1):
  for j in range(1,100,1):
    if input_num == i * J:
      print("Yes")
      ans_flag = True
      break;
if not ans_flag:
	print("No")

Fixed submission:
input_num = input()
input_num = int(input_num)
for i in range(1,10,1):
  flag = False
  for j in range(1,10,1):
    if input_num == i * j:
      print("Yes")
      flag = True
      break
  if flag:
    break
if not flag:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = 0
count = 0
for i in range(a):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)

Fixed submission:
a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
a = int(input())
b = 0
count = 0
for i in range(a):
    for j in range(a):
        if (i+1)*(j+1) == a:
            if count == 0:
                count += 1
                c = i+1
                d = j+1
            if count>0:
                if (c+d)>(i+1)+(j+1):
                    c = i+1
                    d = j+1
ans = c+d-2
print(ans)

Fixed submission:
a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = 0
count = 0
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == a:
      count += 1
      if count>0:
        if (c+d)>(i+1)+(j+1):
		  c = i+1
          d = j+1
      else :
        c = i+1
        d = j+1
ans = c+d-2
print(ans)

Fixed submission:
a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = 0
count = 0
for i in range(9):
  for j in range(9):
    if (i+1)*(j+1) == a:
      count += 1
      if count>0:
        if (c+d)>(i+1)+(j+1):
		  c = i+1
          d = j+1
      else :
        c = i+1
        d = j+1
ans = c+d-2
print 

Fixed submission:
a = int(input())
b = 0
l = int(a**0.5)+1
count = 0
for i in range(l):
    i = i+1
    if a%i == 0:
        j = a//i
    if i*j == a:
        if count == 0:
            count += 1
            c = i
            d = j
        if count>0:
            if (c+d)>(i+j):
                c = i
                d = j
ans = c+d-2
print(ans)
Buggy python submission (verdict: Runtime Error):
x=int(input())
if x<1200:
      print(ABC)
else:
      print(ARC)


Fixed submission:
x=int(input())
if x < 1200:
      print("ABC")
else:
      print("ARC")

Buggy python submission (verdict: Runtime Error):
x=int(input(())
if x<1200:
      print(ABC)
else:
      print(ARC)

Fixed submission:
x=int(input())
if x < 1200:
      print("ABC")
else:
      print("ARC")
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
n=A-(B*2)
if n>=0:
    print(n)
else:
    print(o)

Fixed submission:
A,B=map(int,input().split())
n=A-(B*2)
if n>=0:
    print(n)
else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())


if a//10!=0:
    print(-1)

elif b//10!=0:
    print(-1)

else:
    print(a*b)


Fixed submission:
n=int(input())
flag=False

for i in range(1,10):
    for j in range(1,10):
        if i*j==n:
            flag=True

if flag==True:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
import math


def f(a: float, b: float, theta: float) -> float:
    # 求める角度をθとすると三角形の底辺はb*tan(π/2-θ)となる
    # つまり以下の条件を満たす最大のθを求めればよい
    # b*tan(π/2-θ) * b * 1/2 >= x / a
    if theta > (90.0 - 0.0000000001):
        return 0.0
    t = b * math.tan(math.radians(90.0 - theta))
    if t <= a:
        return b * t / 2
    else:
        top = b - (a * math.tan(math.radians(theta)))
        return (b + top) * a / 2


def water_bottle(a: int, b: int, x: int) -> float:
    ok = 90.0
    ng = 0.0
    water = x / a
    for _ in range(100000):
        mid = (ok + ng) / 2.0
        if f(a, b, mid) < water:
            ok = mid
        else:
            ng = mid
    return ok


if __name__ == '__main__':
    abx = list(map(int, input().split()))
    result = water_bottle(abx[0], abx[1], abx[2])
    print(result)

Fixed submission:
import math


def f(a: float, b: float, theta: float) -> float:
    # 求める角度をθとすると三角形の底辺はb*tan(π/2-θ)となる
    # つまり以下の条件を満たす最大のθを求めればよい
    # b*tan(π/2-θ) * b * 1/2 >= x / a
    if theta > (90.0 - 0.0000000001):
        return 0.0
    t = b * math.tan(math.radians(90.0 - theta))
    if t <= a:
        return b * t / 2
    else:
        top = b - (a * math.tan(math.radians(theta)))
        return (b + top) * a / 2


def water_bottle(a: int, b: int, x: int) -> float:
    ok = 90.0
    ng = 0.0
    water = x / a
    for _ in range(10000):
        mid = (ok + ng) / 2.0
        if f(a, b, mid) < water:
            ok = mid
        else:
            ng = mid
    return ok


if __name__ == '__main__':
    abx = list(map(int, input().split()))
    result = water_bottle(abx[0], abx[1], abx[2])
    print(result)
Buggy python submission (verdict: Time Limit Exceeded):
nkq = list(map(int, input().split()))
n, k, q = nkq[0], nkq[1], nkq[2]
attendees = dict()
for i in range(n):
    attendees[i] = k

attendees = [(i, k) for i in range(n)]

respondents = [int(input()) for i in range(q)]

for r in respondents:
    r_index = r - 1
    for a in attendees:
        i, p = a
        if i != r_index:
            attendees[i] = (i, p - 1)

for a in attendees:
    i, p = a
    if p > 0:
        print("Yes")
    else:
        print("No")


Fixed submission:
nkq = list(map(int, input().split()))
n, k, q = nkq[0], nkq[1], nkq[2]
attendees = dict()
for i in range(n):
    attendees[i] = 0

respondents = [int(input()) for i in range(q)]

for r in respondents:
    r_index = r - 1
    attendees[r_index] += 1

for i, p in attendees.items():
    point = p + k - q
    if point > 0:
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Time Limit Exceeded):
def is_anagram(s1: str, s2: str) -> bool:
    size1, size2 = len(s1), len(s2)
    if size1 != size2:
        return False

    d1, d2 = dict(), dict()

    for i in range(size1):
        c1, c2 = s1[i], s2[i]
        count1, count2 = d1.get(c1), d2.get(c2)
        if count1 is None:
            d1[c1] = 1
        else:
            d1[c1] = count1 + 1
        if count2 is None:
            d2[c2] = 1
        else:
            d2[c2] = count2 + 1

    return d1 == d2

n = int(input())
ss = [input() for _ in range(n)]

counter = 0

for index1 in range(n):
    for index2 in range(index1 + 1, n):
        if is_anagram(ss[index1], ss[index2]):
            counter += 1

print(counter)



Fixed submission:
from math import factorial


def combination2(num: int) -> int:
    return int(factorial(num) / (2 * factorial(num - 2)))


n = int(input())
ss = [input() for _ in range(n)]

dictionary = {}

for s in ss:
    sorted_string = "".join(sorted(s))
    count = dictionary.get(sorted_string)
    if count is None:
        dictionary[sorted_string] = 1
    else:
        dictionary[sorted_string] = count + 1

counter = 0

for count in dictionary.values():
    if count > 1:
        counter += combination2(count)

print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
def is_anagram(s1: str, s2: str) -> bool:
    if len(s1) != len(s2):
        return False

    d1, d2 = dict(), dict()
    for s in list(s1):
        count = d1.get(s)
        if count is None:
            d1[s] = 1
        else:
            d1[s] = count + 1
    for s in list(s2):
        count = d2.get(s)
        if count is None:
            d2[s] = 1
        else:
            d2[s] = count + 1
    return d1 == d2


n = int(input())
ss = [input() for _ in range(n)]

counter = 0

for i in range(n):
    for j in range(i + 1, n):
        if is_anagram(ss[i], ss[j]):
            counter += 1

print(counter)


Fixed submission:
from math import factorial


def combination2(num: int) -> int:
    return int(factorial(num) / (2 * factorial(num - 2)))


n = int(input())
ss = [input() for _ in range(n)]

dictionary = {}

for s in ss:
    sorted_string = "".join(sorted(s))
    count = dictionary.get(sorted_string)
    if count is None:
        dictionary[sorted_string] = 1
    else:
        dictionary[sorted_string] = count + 1

counter = 0

for count in dictionary.values():
    if count > 1:
        counter += combination2(count)

print(counter)
Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heapify, heappop

nm = list(map(int, input().split()))
n, m = nm[0], nm[1]
d = {}
ab_list = list()
for i in range(n):
    ab = list(map(int, input().split()))
    rem_day, reward = ab[0], ab[1]
    if rem_day in d:
        d[rem_day].append(-reward)
    else:
        d[rem_day] = [-reward]


result = 0

candidates = list()

for rem in range(1, m + 1):
    added_candidates = d.get(rem)
    if added_candidates is not None and len(added_candidates) > 0:
        candidates.extend(added_candidates)

    if len(candidates) > 0:
        heapify(candidates)
        top = heappop(candidates)
        result += -top

print(result)


Fixed submission:
from heapq import heapify, heappop, heappush

nm = list(map(int, input().split()))
n, m = nm[0], nm[1]
d = {}
ab_list = list()
for i in range(n):
    ab = list(map(int, input().split()))
    rem_day, reward = ab[0], ab[1]
    if rem_day in d:
        d[rem_day].append(-reward)
    else:
        d[rem_day] = [-reward]


result = 0

candidates = list()

for rem in range(1, m + 1):
    added_candidates = d.get(rem)
    if added_candidates is not None:
        for ac in added_candidates:
            heappush(candidates, ac)

    if len(candidates) > 0:
        top = heappop(candidates)
        result += -top

print(result)

Buggy python submission (verdict: Time Limit Exceeded):
from heapq import heapify, heappop

nm = list(map(int, input().split()))
n, m = nm[0], nm[1]
ab_list = list()
for i in range(n):
    ab = list(map(int, input().split()))
    a, b = ab[0], ab[1]
    ab_list.append((-b, a))


result = 0

candidates = list()

for rem in range(1, m + 1):
    added_candidate = list(filter(lambda x: x[1] == rem, ab_list))
    if len(added_candidate) > 0:
        candidates.extend(added_candidate)

    if len(candidates) > 0:
        heapify(candidates)
        top = heappop(candidates)
        result += -top[0]

print(result)


Fixed submission:
from heapq import heapify, heappop, heappush

nm = list(map(int, input().split()))
n, m = nm[0], nm[1]
d = {}
ab_list = list()
for i in range(n):
    ab = list(map(int, input().split()))
    rem_day, reward = ab[0], ab[1]
    if rem_day in d:
        d[rem_day].append(-reward)
    else:
        d[rem_day] = [-reward]


result = 0

candidates = list()

for rem in range(1, m + 1):
    added_candidates = d.get(rem)
    if added_candidates is not None:
        for ac in added_candidates:
            heappush(candidates, ac)

    if len(candidates) > 0:
        top = heappop(candidates)
        result += -top

print(result)
Buggy python submission (verdict: Time Limit Exceeded):
# ABC C - Go to school

N = int(input())
A = list(map(int, input().split()))
_list = []

for i in range(1,N+1):
    _list.append(A.index(i) +1 )

for j in range(len(_list)):
    print(_list[j], end = ' ')

print()

Fixed submission:
# ABC C - Go to school


N = int(input())
A = list(map(int, input().split()))
Q = []

for i in range(N):
    Q.append(1)

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

for i in range(N):
    print(Q[i], end = ' ')

print()

Buggy python submission (verdict: Time Limit Exceeded):
# ABC C - Go to school

N = int(input())
A = list(map(int, input().split()))
list = []

for i in range(1,N+1):
    print(A.index(i)+1,end= ' ')

print()


Fixed submission:
# ABC C - Go to school


N = int(input())
A = list(map(int, input().split()))
Q = []

for i in range(N):
    Q.append(1)

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

for i in range(N):
    print(Q[i], end = ' ')

print()
Buggy python submission (verdict: Time Limit Exceeded):
# ABC141 C - Attack Survival

N, K, Q = map(int, input().split())

P = []

for i in range(N):
    P.append(K)

for i in range(Q):
    A = int(input())
    for j in range(len(P)):
        if j != (A - 1):
            P[j] -= 1


for i in range(len(P)):
    if P[i] <= 0:
        print('No')
    else:
        print('Yes')

Fixed submission:
# ABC141 C - Attack Survival

N, K, Q = map(int, input().split())

P = []

for i in range(N):
    P.append(K - Q)

for i in range(Q):
    P[int(input()) - 1] += 1

for i in range(len(P)):
    if P[i] <= 0:
        print('No')
    else:
        print('Yes')
Buggy python submission (verdict: Time Limit Exceeded):
# ABC141 D -Powerful Discount Tickets

import numpy

N, M = map(int,input().split())

str_A = input().split()
int_A = [int(n) for n in str_A]

for i in range(M):
    int_A[numpy.argmax(int_A)] = numpy.max(int_A)//2

print(sum(int_A))

Fixed submission:
# ABC141 D -Powerful Discount Tickets

import heapq
import math

N, M = map(int,input().split())

A = [-int(n) for n in input().split()]

heapq.heapify(A)


for i in range(M):
    heapq.heappush(A, math.ceil(heapq.heappop(A)/2))

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
# ABC141 D -Powerful Discount Tickets

import numpy

N, M = map(int,input().split())

str_A = input().split()
int_A = [int(n) for n in str_A]

for i in range(M):
    int_A[numpy.argmax(int_A)] = max(int_A)//2

print(sum(int_A))

Fixed submission:
# ABC141 D -Powerful Discount Tickets

import heapq
import math

N, M = map(int,input().split())

A = [-int(n) for n in input().split()]

heapq.heapify(A)


for i in range(M):
    heapq.heappush(A, math.ceil(heapq.heappop(A)/2))

print(-sum(A))

Buggy python submission (verdict: Time Limit Exceeded):
# ABC141 D -Powerful Discount Tickets

import numpy

N, M = map(int,input().split())

str_A = input().split()
int_A = [int(n) for n in str_A]

for i in range(M):
    m_index = numpy.argmax(int_A)
    int_A[m_index] = max(int_A)//2

print(sum(int_A))

Fixed submission:
# ABC141 D -Powerful Discount Tickets

import heapq
import math

N, M = map(int,input().split())

A = [-int(n) for n in input().split()]

heapq.heapify(A)


for i in range(M):
    heapq.heappush(A, math.ceil(heapq.heappop(A)/2))

print(-sum(A))
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

if (a >= 1 and a <= 9 and b >= 1 and b <= 9):
  print(a*b)
else:
  print(-1)

Fixed submission:
a, b = map(int, input().split())

if (a <= 9 and b <= 9):
  print(a*b)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
tall = int(input())
bit = round(tall**(1/2))
while (bit/tall%1 != 0):
  bit -= 1
print(bit+tall/b-2)

Fixed submission:
tall = int(input())
bit = int(tall**(1/2))
while ((tall/bit)%1 != 0):
  bit -= 1
print(int(bit+tall/bit-2))
Buggy python submission (verdict: Runtime Error):
A,B,C = [int(i) for i in input().split()]
Flag = False

for i in range(1,B+1):
    D = i*A % B
    if D = C:
        Flag = True
        break

if Flag == True:
    print('YES')
else:
    print('NO')


Fixed submission:
A,B,C = [int(i) for i in input().split()]
Flag = False

for i in range(1,B+1):
    D = i*A % B
    if D == C:
        Flag = True
        break

if Flag == True:
    print('YES')
else:
    print('NO')