Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
A = list(map(int, input().split()))
all_vote = sum(A)
cnt = 0
for a in A:
    if a * 4 * m >= all_vote:#1/4mを4m倍したときとおきかえて計算(整数にするため)
        cnt += 1
if cnt >= m:
    print("Yes")
else:
    print("No")

Fixed submission:
n, k = map(int, input().split())
m = n%k
print(min(m,k-m))
Buggy python submission (verdict: Runtime Error):
even, odd = map(int,input().split())
print((even*~-even // 2) + (odd*=~-odd // 2))

Fixed submission:
n, m = map(int, input().split())
print((n * ~-n // 2) + (m* ~-m // 2))#n * ~-n == n*(n-1)

Buggy python submission (verdict: Runtime Error):
even, odd = map(int,input().split())
print((even*~-n // 2) + (odd*=~-odd // 2))

Fixed submission:
n, m = map(int, input().split())
print((n * ~-n // 2) + (m* ~-m // 2))#n * ~-n == n*(n-1)

Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
list = input().rstrip().split(" ")
gusu = int(list[0])
kisu = int(list[1])
#奇数奇数の場合
kiki = int(comb(kisu, 2, exact=True))
#偶数偶数の場合
gugu = int(comb(gusu, 2, exact=True))
print(kiki + gugu)

Fixed submission:
n, m = map(int, input().split())
print((n * ~-n // 2) + (m* ~-m // 2))#n * ~-n == n*(n-1)

Buggy python submission (verdict: Runtime Error):
list = input().rstrip().split(" ")
kisu = int(list[1])
gusu = int(list[0])
#奇数奇数の場合
kiki = kisu * (kisu - 1
#偶数偶数の場合

Fixed submission:
n, m = map(int, input().split())
print((n * ~-n // 2) + (m* ~-m // 2))#n * ~-n == n*(n-1)
Buggy python submission (verdict: Runtime Error):
s = st(input())
string = list(s)
cnt = sum(string)
print("x" * int(cnt))

Fixed submission:
s = str(input())
string = list(s)
cnt = len(string)
print("x" * cnt)

Buggy python submission (verdict: Runtime Error):
s = st(input())
string = list(s)
cnt = sum(string)
print("x" * int(cnt))

Fixed submission:
s = str(input())
string = list(s)
cnt = len(string)
print("x" * cnt)

Buggy python submission (verdict: Runtime Error):
s = st(input())
string = list(s)
cnt = sum(string)
print("x" * cnt)

Fixed submission:
s = str(input())
string = list(s)
cnt = len(string)
print("x" * cnt)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
A = list(str(a) * b)
B = list(str(b) * a)
if A[0] >= b[0]:
    print(str(a)*b)
else:
    print(str(b)*a)

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

l = ['{}'.format(a)*b, '{}'.format(b)*a]
l.sort()
print(l[0])
Buggy python submission (verdict: Runtime Error):
n = int(input())
price = n *25 / 27
p = price.is_integer()
if p = True:
    print(price // 1)
else:
    print(":(")

Fixed submission:
n = int(input())
for i in range(50000):
    if int(i*1.08) == n:
        print(i)
        exit()
print(":(")

Buggy python submission (verdict: Runtime Error):
n = int(input())
price = n *25 / 27
if price.is_integer() = True:
    print(price // 1)
else:
    print(":(")

Fixed submission:
n = int(input())
for i in range(50000):
    if int(i*1.08) == n:
        print(i)
        exit()
print(":(")
Buggy python submission (verdict: Runtime Error):
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")

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):
a, b = map(int, input().split())
if a<=9 and b<=:
    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):
import math
a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print(floor((a+b) / 2))
else:
    print("IMPOSSIBLE")

Fixed submission:
a, b = map(int, input().split())
if (b-a) % 2 == 0:
    print((a+b) // 2)
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    total = c
    for j in range(m):
        total += a[i][j] * b[j]
    if total > 0:
        ans += 1
print(ans)

Fixed submission:
n, m, c = map(int, input().split())
B = list(map(int, input().split()))
A = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in range(n):
    total = c
    for j in range(m):
        total += A[i][j] * B[j]
    if total > 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
a, b, c = map(int, input().split())
cnt = 0
while True:
    if a == b == c and a%2 == 0:
        cnt = -1
    elif a%2 == 0 and b%2 == 0 and c%2 == 0:
        a, b, c, = (b+c)//2, (a+c)//2, (a+b)//2
        cnt += 1
print(cnt)

Fixed submission:
a, b, c = map(int, input().split())
cnt = 0
while True:
    if a == b == c and a%2 == 0:
        cnt = -1
        break
    elif a%2 != 0 or b%2 != 0 or c%2 != 0:
        break
    elif a%2 == 0 and b%2 == 0 and c%2 == 0:
        a, b, c, = (b+c)//2, (a+c)//2, (a+b)//2
        cnt += 1
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, c = map(int, input().split())
cnt = 0
while True:
    if a == b == c and a%2 == 0:
        cnt = -1
    elif a%2 == 0 and b%2 == 0 and c%2 == 0:
        a, b, c, = (b+c)//2, (a+c)//2, (a+b)//2
        cnt += 1
print(cnt)

Fixed submission:
a, b, c = map(int, input().split())
cnt = 0
while True:
    if a == b == c and a%2 == 0:
        cnt = -1
        break
    elif a%2 != 0 or b%2 != 0 or c%2 != 0:
        break
    elif a%2 == 0 and b%2 == 0 and c%2 == 0:
        a, b, c, = (b+c)//2, (a+c)//2, (a+b)//2
        cnt += 1
print(cnt)
Buggy python submission (verdict: Runtime Error):
p = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p < a+b:
        p += 1
        print("Yes")
    elif i == "b" and p < a+b and f < b:
        f += 1
        p += 1
        print("Yes")
    else:
        print("No")

Fixed submission:
p = 0
f = 0
n, a, b = map(int, input().split())
for i in input():
    if i == "a" and p < a+b:
        p += 1
        print("Yes")
    elif i == "b" and p < a+b and f < b:
        p += 1
        f += 1
        print("Yes")
    else:
        print("No")
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for w in range(h)]

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1

n = []
for j in range(w):
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m

for k in range(h):
    print("".join(u[k] for u in n))


Fixed submission:
n,i = input().split()
print(int(n)-int(i)+1)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = [input() for w in range(h)]

for i in range(h)[::-1]:
    if "#" not in a[i]:
        del a[i]
        h -= 1
print(a)

n = []
for j in range(w):
    print("j=" + str(j))
    m = ["".join(t[j] for t in a)]
    if "#" in m[0]:
        n += m
print(n)

for k in range(h):
    print("".join(n[k]))


Fixed submission:
h,w = input().split()
h = int(h)
w = int(w)
inp = []
count = 0
for i in range(h):
    tmp_input = list(input())
    if '#' in tmp_input:
        inp.append(tmp_input)
    else:
        count += 1
inp2 = list(map(list,zip(*inp)))
youso = []
for i in range(w):
    if "#" in inp2[i]:
        pass
    else:
        youso.append(i)
youso.reverse()
if len(youso) != 0:
    for i in range(len(youso)):
        for j in range(h-count):
            del inp[j][youso[i]]
else:
    pass
for i in range(len(inp)):
    mojiretu = ''.join(inp[i])
    print(mojiretu)
Buggy python submission (verdict: Runtime Error):
s = list(input())
k = int(input())
if '1' in s and s.index('1') == 0 :
    print(s[1])
else:
    print(s[0])


Fixed submission:
s = list(input())
k = int(input())
if '1' not in s:
    print(s[0])
else:
    num = 0
    for i in range(len(s)):
        if s[0] == "1":
            s.pop(0)
            num += 1
        else:
            break
    if num >= k:
        print(1)
    else:
        print(s[0])
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += Ct[B]
    L[B] = 0
    print(S)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += L[B]
    L[B] = 0
    print(S)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
D=sum(A)
for i in range(Q):
    count=0
    B,C=map(int,input().split())
    for j in range(N):
        if A[j]==B:
            A[j]=C
            count+=1
    if B<=C:
      D=D+(C-B)*count
      print(D)
    if B>C:
      D=D+(C-B)*count
      print(D)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += L[B]
    L[B] = 0
    print(S)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
for i in range(Q):
    B,C=map(int,input().split())
    for j in range(N):
        if A[j]==B:
            A[j]=C
    print(sum(A))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += L[B]
    L[B] = 0
    print(S)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
Q=int(input())
for i in range(Q):
    B,C=map(int,input().split())
    for j in range(N):
        if A[j]==B:
            A[j]=C
    print(sum(A))

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
S = sum(A)
L = [0] * 100001
for i in A:
    L[i] += 1
Q = int(input())
for i in range(Q):
    B, C = map(int, input().split())
    S += (C - B) * L[B]
    L[C] += L[B]
    L[B] = 0
    print(S)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().splist()))
p = np.sort(np.array(p))

print(np.sum(p[:k]))

Fixed submission:
import numpy as np
n, k = list(map(int, input().rstrip().split()))
p = list(map(int, input().rstrip().split()))
p = np.sort(np.array(p))
 
print(np.sum(p[:k]))
Buggy python submission (verdict: Time Limit Exceeded):
import  collections
import numpy as np

s = input().strip()
t = []
for i in range(len(s)):
    t.append(int(s[i:]) % 2019) 
    
t.append(0)
counts = dict(collections.Counter(t))
counts = np.array(list(counts.values()))
print(int(np.sum(counts * (counts -1) /2)))


Fixed submission:
import numpy as np

s = input().strip()
t = 0
counts = np.array([0] * 2019)
counts[0] += 1
m = 1

for a  in reversed(s):
    t = (t + m * int(a)) % 2019
    counts[t] += 1
    m = m * 10 % 2019
    
print(int(np.sum(counts * (counts - 1) /2)))

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

s = input().strip()
t = []
for i in range(len(s)):
    t.append(int(s[i:]) % 2019)
    
t.append(0)
count = dict(collections.Counter(t))
tot = 0
for c in count.values():
    tot += c*(c-1)/2
print(int(tot))

Fixed submission:
import numpy as np

s = input().strip()
t = 0
counts = np.array([0] * 2019)
counts[0] += 1
m = 1

for a  in reversed(s):
    t = (t + m * int(a)) % 2019
    counts[t] += 1
    m = m * 10 % 2019
    
print(int(np.sum(counts * (counts - 1) /2)))
Buggy python submission (verdict: Runtime Error):
A, B, M = list(map(int, input().rstrip().split()))
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))

cost=[]
for _ in range(M):
    x, y, c = list(map(int, input().rstrip().split()))
    tot = a[x-1] + b[y-1] - c
    cost.append(tot)
    
cost.append(min(a)+min(b))
print(min(cost))


Fixed submission:
s = input().rstrip()
h = ['hi' * i for i in range(1,6)]

if s in h:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
A, B, M = list(map(int, input().rstrip().split()))
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))

cost_sale=[]
for _ in range(M):
    x, y, c = list(map(int, input().rstrip().split()))
    tot = a[x-1] + b[y-1] - c
    cost_sale.append(tot)
    
cost_raw = [i + j for i in a for j in b]
print(min(cost_sale + cost_raw))

Fixed submission:
A, B, M = list(map(int, input().rstrip().split()))
a = list(map(int, input().rstrip().split()))
b = list(map(int, input().rstrip().split()))

cost=[]
for _ in range(M):
    x, y, c = list(map(int, input().rstrip().split()))
    tot = a[x-1] + b[y-1] - c
    cost.append(tot)
    
cost.append(min(a)+min(b))
print(min(cost))
Buggy python submission (verdict: Runtime Error):
import collections
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

Fixed submission:
import collections as coll
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

Buggy python submission (verdict: Runtime Error):
import collections

s = list(input().rstrip())
c = colc.Counter(s)

if len(c.keys()) != 2:
  print("No")

else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")

Fixed submission:
import collections as coll
 
s = list(input().rstrip())
c = coll.Counter(s)
 
if len(c.keys()) != 2:
  print("No")
 
else:
  if c.most_common()[0][1] != 2:
    print("No")
  else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
n ,x = map(int, input().rstrip().split())
l = map(int, input().rstrip().split())
d=0
count = 1
for i in range(n):
    d += l[i]
    if d > x:
        continue
    count+=1
    
print(count)

Fixed submission:
x, a = map(int, input().rstrip().split())
if x < a:
  print(0)
else:
  print(10)

Buggy python submission (verdict: Runtime Error):
x, a = map(int, input().sprit().split())
if x < a:
  print(10)
else:
  print(0)

Fixed submission:
x, a = map(int, input().rstrip().split())
if x < a:
  print(0)
else:
  print(10)
Buggy python submission (verdict: Runtime Error):
N, K = input().split()
p = [int(i) for i in input().split()]
p_ascending = p.sort()
total = 0
for i in p_ascending[0,int(K)]:
  total += i
  
print(total)
  

Fixed submission:
N, K = map(int, input().split())
p = [int(i) for i in input().split()]
p.sort()
total = 0
for i in p[:int(K)]:
  total += i
  
print(total)

Buggy python submission (verdict: Runtime Error):
N, K = int(input())
p = [int(i) for i in input().split()]
p_ascending = p.sort()
total = 0
for i in p_ascending[0,K]:
  total += i
  
print total
  

Fixed submission:
N, K = map(int, input().split())
p = [int(i) for i in input().split()]
p.sort()
total = 0
for i in p[:int(K)]:
  total += i
  
print(total)
Buggy python submission (verdict: Runtime Error):
number = int(input())
  
if 7 in number:
	print("Yes")
else:
	print("No")

Fixed submission:
number = input()
  
if '7' in number:
	print("Yes")
else:
	print("No")

Buggy python submission (verdict: Runtime Error):
number = input()
  
if 7 in number:
	print("Yes")
else:
	print("No")

Fixed submission:
number = input()
  
if '7' in number:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
l = []
for i in range(M):
  a = input().split()
  l.append([int(a[0]), a[1]])

ansewered_question = set([l[i][0] for i in range(len(l))])

AC = 0
WA = 0
for i in ansewered_question:
    wa = 0
    for submit in l:
        if submit[0] == i:
            if submit[1] == "WA":
                wa += 1
            else:
                AC += 1
                WA += wa
                break

print(AC, WA)

Fixed submission:
N, M = map(int, input().split())
l = []
ansewered_question = set()
submit_for = {}

for i in range(M):
  a = input().split()
  l.append([int(a[0]), a[1]])
  ansewered_question.add(int(a[0]))
for submition in l:
    if submition[0] in submit_for:
        submit_for[submition[0]].append(submition[1])
    else:
        submit_for[submition[0]] = [submition[1]]
AC = 0
WA = 0
for i in ansewered_question:
    wa = 0
    for submit in submit_for[i]:
      if submit == "WA":
        wa += 1
      else:
          AC += 1
          WA += wa
          break
print(AC, WA)

Buggy python submission (verdict: Time Limit Exceeded):
N, M = map(int, input().split())
l = []
for i in range(M):
  a = input().split()
  l.append([int(a[0]), a[1]])

AC = 0
WA = 0
for i in range(0, N + 1):
    wa = 0
    for submit in l:
        if submit[0] == i:
            if submit[1] == "WA":
                wa += 1
            else:
                AC += 1
                WA += wa
                break

print(AC, WA)

Fixed submission:
N, M = map(int, input().split())
l = []
ansewered_question = set()
submit_for = {}

for i in range(M):
  a = input().split()
  l.append([int(a[0]), a[1]])
  ansewered_question.add(int(a[0]))
for submition in l:
    if submition[0] in submit_for:
        submit_for[submition[0]].append(submition[1])
    else:
        submit_for[submition[0]] = [submition[1]]
AC = 0
WA = 0
for i in ansewered_question:
    wa = 0
    for submit in submit_for[i]:
      if submit == "WA":
        wa += 1
      else:
          AC += 1
          WA += wa
          break
print(AC, WA)
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
r = [S[:N].count("#") + S[N:].count(".") for _ in range(N)]  
print(min(r))

Fixed submission:
A, B, C = map(int, input().split())
if A <= C and C <= B :
    print("Yes")
elif B <= C and C <= A :
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()
count = 0
for i, s in enumerate(S.split("#")):
     if i == 0:
         continue
     else:
         count += s.count(".")
if count > S.count("#"):
    count = S.count("#")
print(count)


Fixed submission:
A, B, C = map(int, input().split())
if A <= C and C <= B :
    print("Yes")
elif B <= C and C <= A :
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def func_a(argv):
    A = int(argv[0]) if int(argv[0]) >= 1 else 0
    B = int(argv[1]) if int(argv[1]) <= 20 else 0

    if A * B == 0:
        pass
    else:
        if B % A == 0:
            print(A + B)
        else:
            print(B - A)


if __name__ == "__main__":
    func_a(sys.argv)


Fixed submission:
# -*- coding: utf-8 -*-

def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

  if A * B == 0:
    pass
  else:
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)


if __name__ == "__main__":
  func_a()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
import sys


def func_a(argv):
    A = int(argv[0]) if int(argv[0]) >= 1 else 0
    B = int(argv[1]) if int(argv[1]) <= 20 else 0

    if A * B == 0:
        pass
    else:
        if B % A == 0:
            print(A + B)
        else:
            print(B - A)


if __name__ == "__main__":
    func_a(sys.argv[1:])


Fixed submission:
# -*- coding: utf-8 -*-

def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

  if A * B == 0:
    pass
  else:
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)


if __name__ == "__main__":
  func_a()

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys


def func_a(argv):
    A = int(argv[0])
    B = int(argv[1])

    if not (A >= 1):
        pass

    if not (B <= 20):
        pass

    if A <= B:
        if B % A == 0:
            print(A + B)
        else:
            print(B - A)


def main(argv):
    func_a(argv[1:])


if __name__ == "__main__":
    main(sys.argv)


Fixed submission:
# -*- coding: utf-8 -*-

def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

  if A * B == 0:
    pass
  else:
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)


if __name__ == "__main__":
  func_a()

Buggy python submission (verdict: Runtime Error):
import sys 

A = int(sys.argv[1])
B = int(sys.argv[2])

if not (A >= 1):
  pass

if not (B <= 20):
  pass

if A <= B:
  if B % A == 0:
    print(A + B)
  else:
    print(B - A)

Fixed submission:
# -*- coding: utf-8 -*-

def func_a():
  argv = input().split(" ")
  A = int(argv[0]) if int(argv[0]) >= 1 else 0
  B = int(argv[1]) if int(argv[1]) <= 20 else 0

  if A * B == 0:
    pass
  else:
    if B % A == 0:
      print(A + B)
    else:
      print(B - A)


if __name__ == "__main__":
  func_a()
Buggy python submission (verdict: Runtime Error):
 a, b, c = map( int, imput().split())
if b + c<= a:
  print(0)
else:
  print(b+ c -a)

Fixed submission:
a, b, c = map( int, input().split())
if b + c<= a:
  print(0)
else:
  print(b+ c -a)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())

for a in range(101):
  b = x - a
  if 2 * a + 4 * b == Y:
    print('Yes')
    exit()
print('No')

Fixed submission:
X, Y = map(int, input().split())

for a in range(101):
  b = X - a
  if 2 * a + 4 * b == Y and b >= 0:
    print('Yes')
    exit()
print('No')
Buggy python submission (verdict: Time Limit Exceeded):
from collections import Counter
import bisect

N = int(input())
cnt_A = Counter(map(int, input().split()))
keys = sorted(cnt_A.keys())
max_keys = max(keys)
flags = {key: True for key in keys}

for key in keys:
    if flags[key] is False:
        continue

    factor = 2
    while key * factor <= max_keys:
        idx = bisect.bisect(keys, key * factor)
        if keys[max(0, idx - 1)] == key * factor:
            del cnt_A[key * factor]
            flags[key * factor] = False
        factor += 1

print(sum([val if val == 1 else 0 for val in cnt_A.values()]))



Fixed submission:
from collections import Counter
import bisect

N = int(input())
cnt_A = Counter(map(int, input().split()))
keys = sorted(cnt_A.keys())
max_keys = max(keys)
flags = {key: True for key in keys}

for key in keys:
    if flags[key] is False:
        continue

    factor = 2
    while key * factor <= max_keys:
        idx = bisect.bisect(keys, key * factor)
        if keys[max(0, idx - 1)] == key * factor:
            del cnt_A[key * factor]
            flags[key * factor] = False
        factor += 1

print(sum([val if val == 1 else 0 for val in cnt_A.values()]))
Buggy python submission (verdict: Runtime Error):
a, v = map(int, input().split())
b, w = map(int, input().split())
t = int(input())

if a = b:
  print('YES')
elif a < b:
  if b - w * t <= a - v * t:
    print('YES')
  else:
    print('NO')
else:
  if a + v * t <= b + w * t:
    print('YES')
  else:
	  print('NO')
  


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

if a == b:
  print('YES')
elif a < b:
  if b + w * t <= a + v * t:
    print('YES')
  else:
    print('NO')
else:
  if a - v * t <= b - w * t:
    print('YES')
  else:
	  print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
MAX_VAL = 10 ** 18

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

if 0 in A:
    print(0)
    exit()

ans = 1
for a in A:
    ans *= a

if ans > MAX_VAL:
    print(-1)
else:
    print(ans)


Fixed submission:
MAX_VAL = 10 ** 18

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

if 0 in A:
    print(0)
    exit()

ans = 1
for i, a in enumerate(A):
    if i == 0:
        ans = a
    else:
        ans *= a

    if ans > MAX_VAL:
        print(-1)
        exit()

print(ans)