Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n11, n12, n13 = (input().split())
n21, n22, n23 = (input().split())
n31, n32, n33 = (input().split())

lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false

Fixed submission:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
n11, n12, n13 = int(input().split())
n21, n22, n23 = int(input().split())
n31, n32, n33 = int(input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = []
for(i in range(int(input()))):
  nums.append(input())
flag = false
for(l in lines):
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("No")
else:
  print("Yes")
    


Fixed submission:
n11, n12, n13 = map(int,input().split())
n21, n22, n23 = map(int,input().split())
n31, n32, n33 = map(int,input().split())
lines = [[n11,n12,n13],
         [n21,n22,n23],
         [n31,n32,n33],
         [n11,n21,n31],
         [n12,n22,n32],
         [n13,n23,n33],
         [n11,n22,n33],
         [n13,n22,n31]]
nums = {}
r = input()
for i in range(int(r)):
  nums[int(input())] = 0
flag = False
for l in lines:
  if l[0] in nums:
    if l[1] in nums:
      if l[2] in nums:
        flag = True
if flag:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)

Fixed submission:
h = int(input())
w = int(input())
n = int(input())
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)

Buggy python submission (verdict: Runtime Error):
h = input()
w = input()
n = input()
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
return x
  


Fixed submission:
h = int(input())
w = int(input())
n = int(input())
count = 0
if h < w:
  a = w
  b = h
else:
  a = h
  b = w
 
x = int(n/a)
if n%a != 0:
  x += 1
print(x)
Buggy python submission (verdict: Runtime Error):
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:total/2] is s[total/2:]):
    print("Yes")
  else:
      print("No")

Fixed submission:
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:int(total/2)] == s[int(total/2):]):
    print("Yes")
  else:
      print("No")

Buggy python submission (verdict: Runtime Error):
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:total/2]==s[total/2:]):
    print("Yes")
  else:
      print("No")

Fixed submission:
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:int(total/2)] == s[int(total/2):]):
    print("Yes")
  else:
      print("No")

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

if total%2 == 1:
  print("No")
else:
	if(s[:total/2]==s[total/2:]):
		print("Yes")
	else:
		print("No")

Fixed submission:
total = int(input())
s = input()
 
if total%2 == 1:
  print("No")
else:
  if(s[:int(total/2)] == s[int(total/2):]):
    print("Yes")
  else:
      print("No")
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split()) 
H = list(map(int, input().split())) 

A=[0 for i in range(N)]
B=[0 for i in range(N)]
for i in range(M):
    A[i],B[i]=map(int,input().split())
    A[i] -= 1
    B[i] -= 1

ans = 0
idx = 0
while idx < N:
    i = 0
    cnt = 0
    while i < M:
        if A[i] == idx:
            if H[idx] <= H[B[i]]:
                cnt += 1
                break
        if B[i] == idx:
            if H[idx] <= H[A[i]]:
                cnt += 1
                break
        i += 1
    
    if i == M:
        ans += 1
    elif i == M and cnt == 0:
        ans += 1
    
    idx += 1

print(ans)

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

G = [[] for j in range(N)]
for i in range(M):
    a, b = map(int, input().split()) 
    G[a - 1].append(H[b - 1])
    G[b - 1].append(H[a - 1])

ans = 0
for i, g in enumerate(G):
    if not g:
        ans += 1
        continue
    if H[i] > max(g):
        ans += 1

print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n,m=[int(x) for x in input().split()]
h=[int(x) for x in input().split()]

route=[[0]*n for _ in range(n)]

for i in range(m):
    a,b=[int(x) for x in input().split()]
    a-=1
    b-=1

    if h[b]>=h[a]:
        route[a][b]=1
    if h[a]>=h[b]:
        route[b][a]=1


SUM=0
for i in range(n):

    if sum(route[i])==0:
        SUM+=1

print(SUM)

Fixed submission:
n,m=[int(x) for x in input().split()]
h=[int(x) for x in input().split()]

route=[1]*n

for i in range(m):
    a,b=[int(x) for x in input().split()]
    a-=1
    b-=1

    if h[b]>=h[a]:
        route[a]=0
    if h[a]>=h[b]:
        route[b]=0



print(sum(route))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=[int(x) for x in input().split()]

ma=0
for i in range(1,min(b,n)+1):
    ma=max(ma,(i*a)//b-a*(i//b))
print(ma)


Fixed submission:
a,b,n=[int(x) for x in input().split()]

i=min(b-1,n)
print((i*a)//b-a*(i//b))

Buggy python submission (verdict: Time Limit Exceeded):
a,b,n=[int(x) for x in input().split()]

ma=0
for i in range(1,n+1):
    ma=max(ma,(i*a)//b-a*(i//b))
print(ma)

Fixed submission:
a,b,n=[int(x) for x in input().split()]

i=min(b-1,n)
print((i*a)//b-a*(i//b))
Buggy python submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Fixed submission:
X,Y,Z=[int(x) for x in input().split()]
(X,Y)=(Y,X)
(X,Z)=(Z,X)
print(X,Y,Z)

Buggy python submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Fixed submission:
X,Y,Z=[int(x) for x in input().split()]
(X,Y)=(Y,X)
(X,Z)=(Z,X)
print(X,Y,Z)
Buggy python submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Fixed submission:
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy python submission (verdict: Runtime Error):
L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1

days=[]
for i in range(k):
    if L[i]==R[i]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Fixed submission:
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)

Buggy python submission (verdict: Runtime Error):
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]
i=0
while i < n:
    
    if s[i]=="o":
        L.append(i)
        i+=2
    i+=1

i=0
while i < n:
    
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=2
    i+=1
    


days=[]

for i in range(k):
    
    if L[i]==R[i]:
        days.append(L[i])

for i in range(len(days)):
    print(days[i])

Fixed submission:
n,k,c=[int(x) for x in input().split()]
s=list(input())

L=[]
R=[]

i=0
while i < n:  
    if s[i]=="o":
        L.append(i)
        i+=c
    i+=1

i=0
while i < n:
    if s[n-i-1]=="o":
        R.append(n-i-1)
        i+=c
    i+=1
    
days=[]
for i in range(k):
    if L[i]==R[k-i-1]:
        days.append(L[i])


for i in range(len(days)):
    print(days[i]+1)
Buggy python submission (verdict: Time Limit Exceeded):
s = int(input())
a = b = 0
for i in range(-1000,1000):
  for j in range(-1000,1000):
    if i**5 - j**5 == s:
      print(i,j)
      break

Fixed submission:
import sys
s = int(input())
for i in range(-120,120):
  for j in range(-120,120):
    if i**5 - j**5 == s:
      print(i,j)
      sys.exit()
Buggy python submission (verdict: Runtime Error):
import math
print(2*math.pi*int(input))

Fixed submission:
import math
print(2*float(input())*math.pi)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
e,o = map(int,input().split())

base1 = comb(e, 2, exact=True)
base2 = comb(o, 2, exact=True)

print(base1+base2)

Fixed submission:
e,o = map(int,input().split())
cte = (e*(e-1))//2
cto = (o*(o-1))//2
print(cte+cto)
Buggy python submission (verdict: Runtime Error):
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/4m*sum(a)))
c=0
for i in a:
	if i>=t:c+=1
print(["NO"]["YES"][c==m])


Fixed submission:
import math
def I(): return(list(map(int,input().split())))
n,m=I()
a=I()
t=math.ceil((1/(4*m))*sum(a))
c=0
for i in a:
	if i>=t:c+=1
print(["No","Yes"][c>=m])
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
for j in ans:
    print(j)

Fixed submission:
r = int(input())
print(2*r*3.14)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
    a = [n for n in a if n != i]
for j in ans:
    print(j)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
    a = [n for n in a if n != i]
for j in ans:
    print(j)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
for j in ans:
    print(j)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
for j in ans:
    print(j)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = []
for i in range(1,n+1):
    ans.append(a.count(i))
for j in ans:
    print(j)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = [0]*n
for i in a:
    ans[i-1] += 1
for j in ans:
    print(j)
Buggy python submission (verdict: Runtime Error):
n = input()
if 7 in n:
    print('Yes')
else:
    print('No')

Fixed submission:
n = input()
if '7' in n:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
x = 0
n = input(input())
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        x += i
print(x)


Fixed submission:
x = 0
n = int(input())
for i in range(1,n+1):
    if i % 3 != 0 and i % 5 != 0:
        x += i
print(x)
Buggy python submission (verdict: Time Limit Exceeded):
import math
k = int(input())
ans = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    for c in range(1,k+1):
      ans += math.gcd(math.gcd(a,b),c)
print(ans)


Fixed submission:
import math
k = int(input())
ans = 0
for a in range(1,k+1):
  for b in range(1,k+1):
    n = math.gcd(a,b)
    for c in range(1,k+1):
      ans += math.gcd(n,c)
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
while n > abs(n-k):
    n = abs(n-k)
print(n)

Fixed submission:
n,k = map(int,input().split())
n %= k
ans = min(n,abs(n-k))
print(ans)
Buggy python submission (verdict: Runtime Error):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    sc = s.count(i)
    if sc > x:
        ans = [i]
        x = sc
    elif sc == x:
        ans.append(i)
for i in sorted(ans):
    print(i)


Fixed submission:
s = list(map(int,input().split()))
n = list(set(s))
if len(n) == 2:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    sc = s.count(i)
    if sc > x:
        ans = [i]
        x = sc
    elif sc == x:
        ans.append(i)
for i in sorted(ans):
    print(i)


Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())
s.sort()
k = 0
f = s
mk = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    k = k+1
    if k == mk :
      mk = k
      f.append(s[i])
    elif k > mk :
      mk = k
      f = [s[i]]
  else:
    k = 0
for i in range(len(f)):
  print(f[i])

Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    sc = s.count(i)
    if sc > x:
        ans = [i]
        x = sc
    elif sc == x:
        ans.append(i)
for i in sorted(ans):
    print(i)


Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())
s.sort()
k = 0
f = s
mk = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    k = k+1
    if k == mk :
      mk = k
      f.append(s[i])
    elif k > mk :
      mk = k
      f = [s[i]]
  else:
    k = 0
for i in range(len(f)):
  print(f[i])

Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    sc = s.count(i)
    if sc > x:
        ans.clear()
        ans.append(i)
        x = sc
    elif sc == x:
        ans.append(i)
for i in sorted(ans):
    print(i)

Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())
s.sort()
k = 0
f = s
mk = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    k = k+1
    if k == mk :
      mk = k
      f.append(s[i])
    elif k > mk :
      mk = k
      f = [s[i]]
  else:
    k = 0
for i in range(len(f)):
  print(f[i])

Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    if s.count(i) > x:
        ans.clear()
        ans.append(i)
        x = s.count(i)
    elif s.count(i) == x:
        ans.append(i)
ans.sort()
print("\n".join(ans))

Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())
s.sort()
k = 0
f = s
mk = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    k = k+1
    if k == mk :
      mk = k
      f.append(s[i])
    elif k > mk :
      mk = k
      f = [s[i]]
  else:
    k = 0
for i in range(len(f)):
  print(f[i])

Buggy python submission (verdict: Time Limit Exceeded):
n =int(input())
s = [input() for i in range(n)]
z = list(set(s))
ans = []
x = 0
for i in z:
    if s.count(i) > x:
        ans.clear()
        ans.append(i)
        x = s.count(i)
    elif s.count(i) == x:
        ans.append(i)
for i in sorted(ans):
    print(i)

Fixed submission:
n = int(input())
s = []
for i in range(n):
  s.append(input())
s.sort()
k = 0
f = s
mk = 0
for i in range(n-1):
  if s[i] == s[i+1]:
    k = k+1
    if k == mk :
      mk = k
      f.append(s[i])
    elif k > mk :
      mk = k
      f = [s[i]]
  else:
    k = 0
for i in range(len(f)):
  print(f[i])
Buggy python submission (verdict: Runtime Error):
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] 'ACGT':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)


Fixed submission:
s = input() + 'n'
ans = 0
fans = 0
for i in range(len(s)):
    if s[i] =='A' or s[i] =='C' or s[i] =='G' or s[i] =='T':
        ans += 1
    elif fans < ans:
        fans = ans
        ans = 0
print(fans)
Buggy python submission (verdict: Runtime Error):
6 2 4

Fixed submission:
def resolve():
    N, A, B = map(int, input().split())  

    ao_count = 0

    count_num = N // (A + B)
    amari_num = N % (A + B)



    ao_count = count_num * A

    if A <= amari_num:
        ao_count += A
    else:
        ao_count += amari_num

    print(ao_count)



if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N, A, B = map(int, input().split())  

    MAX_COUNT = 10**(100)
    ao_count = 0

    for i in range(MAX_COUNT):
        if A <= N:
            ao_count += A
            N -= A
        else:
            ao_count += N
            print(ao_count)
            return

        if B <= N:
            N -= B
        else:
            print(ao_count)
            return



if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    N, A, B = map(int, input().split())  

    ao_count = 0

    count_num = N // (A + B)
    amari_num = N % (A + B)



    ao_count = count_num * A

    if A <= amari_num:
        ao_count += A
    else:
        ao_count += amari_num

    print(ao_count)



if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    N = int(input())
    x_list = list(map(int, input().split()))

    x_min = min(x_list)
    x_max = max(x_list)
    hp_min = None

    for i in range(x_min, x_max+1):
        tmp_hp = 0
        for j in x_list:
            tmp_hp += (j - i)**2
        if (hp_min is None) or (tmp_hp < hp_min):
            hp_min = tmp_hp

    print(hp_min)

if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R + 100 * (10 - N)
        print(R)
 
if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Runtime Error):
def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R - 100 * (10 - K)
        print(R)
 
if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    N, R = map(int, input().split())  

    if N >= 10:
        print(R)
    else:
        R = R + 100 * (10 - N)
        print(R)
 
if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input().split()
 
    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(A + " " + B)
 
if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    S, T = input().split()
    A, B = map(int, input().split())
    U = input()

    if S == U:
        A -= 1
    else:
        B -= 1
 
    print(str(A) + " " + str(B))
 
if __name__ == "__main__":
    resolve()
Buggy python submission (verdict: Runtime Error):
211 5
31 41 59 26 53

Fixed submission:
import sys

def propare():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))
    N = int(next(tokens))
    A_list = []
    for i in range(N):
        A_list.append(int(next(tokens)))

    solve(H, N, A_list)

def solve(H: int, N: int, A_list: list):
    sum_a = 0
    for a in A_list:
        sum_a = sum_a + a

    if H <= sum_a:
        print('Yes')
    else:
        print('No')

    return


 
if __name__ == "__main__":
    propare()
Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N = int(input())
    P_list = list(map(int, input().split()))
 
    answer = 0
 
    for i in range(1, len(P_list)+1):
        min_P_list_form_i = min(P_list[0:i])

        if P_list[i-1] <=min_P_list_form_i:
            answer += 1
 
    print(answer)
 
 
if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    N = int(input())
    p = input().split()
    num = 0
    mini = int(p[0])
    for i in range(N):
        if int(p[i])<=mini:
            num+=1
            mini=int(p[i])
    print(num)
 
 
if __name__ == "__main__":
    resolve()

Buggy python submission (verdict: Time Limit Exceeded):
def resolve():
    N = int(input())
    P_list = list(map(int, input().split()))

    answer = 0

    for i in range(1, len(P_list)+1):
        #print("i:" + str(i))
        ok_flag = True
        for j in range(1, i+1):
            #print("j:" + str(j))
            #print(" P_list[i-1]:" + str(P_list[i-1]))
            #print(" P_list[j-1]:" + str(P_list[j-1]))
            if P_list[i-1] <= P_list[j-1]:
                ok_flag = True
            else:
                ok_flag = False
                break
        if ok_flag:
            answer += 1

    print(answer)

 
if __name__ == "__main__":
    resolve()

Fixed submission:
def resolve():
    N = int(input())
    p = input().split()
    num = 0
    mini = int(p[0])
    for i in range(N):
        if int(p[i])<=mini:
            num+=1
            mini=int(p[i])
    print(num)
 
 
if __name__ == "__main__":
    resolve()