Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: count += 1
    else: smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)

Fixed submission:
num, bricks, count, smash = int(input()), [int(x) for x in input().split(" ")], 1, 0
for x in bricks:
    if count == x: count += 1
    else: smash += 1
print(smash if smash != len(bricks) else 0 if len(bricks) == 1 else -1)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print(red)

Fixed submission:
a = int(input())
s = input()
if a >= 3200:
  print(s)
else:
  print('red')
Buggy python submission (verdict: Runtime Error):
x = int(input()) % 10
if x == 6, 1, 8:
	print('pon')
if x == 3:
	print('bon')
else:
	print('hon')

Fixed submission:
x = int(input()) % 10
if x == 6 or x == 1 or x== 8 or x == 0:
	print('pon')
elif x == 3:
	print('bon')
else:
	print('hon')
Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
for B in range(-10**6,10**6):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Fixed submission:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if int((X+B**5)**0.2)-0.0001<=(X+B**5)**0.2<=int((X+B**5)**0.2)+0.0001:
            print(int((X+B**5)**0.2), B)
            break

Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
for B in range(-10**7,10**7):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Fixed submission:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if int((X+B**5)**0.2)-0.0001<=(X+B**5)**0.2<=int((X+B**5)**0.2)+0.0001:
            print(int((X+B**5)**0.2), B)
            break

Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
for B in range(-10**8,10**8):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Fixed submission:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if int((X+B**5)**0.2)-0.0001<=(X+B**5)**0.2<=int((X+B**5)**0.2)+0.0001:
            print(int((X+B**5)**0.2), B)
            break

Buggy python submission (verdict: Time Limit Exceeded):
X=int(input())
for B in range(-10**9,10**9):
    if type((X+B**5)**0.2)!=complex:
        if (X+B**5)**0.2==int((X+B**5)**0.2):
            print(int((X+B**5)**0.2), B)
            break

Fixed submission:
X=int(input())
for B in range(-10**3,10**3):
    if type((X+B**5)**0.2)!=complex:
        if int((X+B**5)**0.2)-0.0001<=(X+B**5)**0.2<=int((X+B**5)**0.2)+0.0001:
            print(int((X+B**5)**0.2), B)
            break
Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
from functools import reduce
from operator import mul
import collections
N = int(input())
l =list(itertools.combinations_with_replacement(range(1,N+1),3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    c=collections.Counter(i)
    if len(c)==1:
        ans+=gcd_list(i)
    elif len(c)==2:
        ans+=3*gcd_list(i)
    elif len(c)==3:
        ans+=6*gcd_list(i)
print(ans)

Fixed submission:
import math
import itertools
from functools import reduce
from operator import mul
import collections
N = int(input())
l =list(itertools.combinations_with_replacement(range(1,N+1),3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    c=collections.Counter(i)
    if len(c)==1:
        ans+=gcd_list(i)
    elif len(c)==2:
        ans+=3*gcd_list(i)
    elif len(c)==3:
        ans+=6*gcd_list(i)
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import math
import itertools
from functools import reduce
from operator import mul

N = int(input())
l =list(itertools.product(range(1,N+1), repeat=3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    ans+=gcd_list(i)
print(ans)

Fixed submission:
import math
import itertools
from functools import reduce
from operator import mul
import collections
N = int(input())
l =list(itertools.combinations_with_replacement(range(1,N+1),3))
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
ans=0
for i in l:
    c=collections.Counter(i)
    if len(c)==1:
        ans+=gcd_list(i)
    elif len(c)==2:
        ans+=3*gcd_list(i)
    elif len(c)==3:
        ans+=6*gcd_list(i)
print(ans)
Buggy python submission (verdict: Runtime Error):
import math
N, M = list(map(int, input().split()))
if N==M==1:
    print(1)
elif M < 2:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2)))

else:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2) +  math.factorial(M)/math.factorial(2)/math.factorial(M-2)))

Fixed submission:
import math
N, M = list(map(int, input().split()))
if N==M==1:
    print(0)
elif M < 2:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2)))
elif N==0:
    print(int(math.factorial(M)/math.factorial(2)/math.factorial(M-2)))
else:
    print(int(math.factorial(N)/math.factorial(2)/math.factorial(N-2) +  math.factorial(M)/math.factorial(2)/math.factorial(M-2)))
Buggy python submission (verdict: Time Limit Exceeded):
from copy import copy
N = int(input())
A= list(map(int, input().split()))
for i in range(N):
    f=0
    a=copy(A)
    a.remove(a[i])
    l=len(a)
    for j in range(l):
        for k in range(j+1,l):
            if a[j]==a[k]:
                f+=1
    print(f)

Fixed submission:
import collections
N = int(input())
A = list(map(int, input().split()))
l = collections.Counter(A)
al = sum([x*(x-1)//2 for x in l.values()])
for i in range(N):
    print(al - (l[A[i]]-1))
Buggy python submission (verdict: Runtime Error):
√çS = str(input())
if S == 'AAA' or S=='BBB':
    print('No')
else:
    print('Yes')

Fixed submission:
S = str(input())
if S == 'AAA' or S=='BBB':
    print('No')
else:
    print('Yes')
Buggy python submission (verdict: Runtime Error):
print(''.join(['x']*len(input()))

Fixed submission:
print(''.join(['x']*len(input())))
Buggy python submission (verdict: Time Limit Exceeded):
A,B,K = map(int, input().split())
for i in range(K):
    if A!=0:
        A=A-1
    else:
        B=B-1
print(A,B)

Fixed submission:
A,B,K = map(int, input().split())
if K>(A+B):
    print(0,0)
elif K>=A:
    print(0, B-(K-A))
else:
    print(A-K,B)
Buggy python submission (verdict: Runtime Error):
import fraction 
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fraction.gcd(x, y)
print(lcm(X,Y))

Fixed submission:
import fractions
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(X,Y))

Buggy python submission (verdict: Runtime Error):
import math 
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
print(lcm(X,Y))

Fixed submission:
import fractions
X,Y = map(int, input().split())
def lcm(x, y):
    return (x * y) // fractions.gcd(x, y)
print(lcm(X,Y))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
S = str(input())
V = []
f=0
s=set()
for i in range(10):
    for j in range(10):
        for k in range(10):
            V.append(str(i)+str(j)+str(k))

for v in V:
    for a in range(N):
        if S[a]==v[0]:
            for b in range(a+1, N):
                if S[b]==v[1]:
                    for c in range(b+1, N):
                        if S[c]==v[2]:
                            s.add(v)
print(len(s))

Fixed submission:
N = int(input())
S = str(input())
V = []
f=0
s=set()
for i in range(10):
    for j in range(10):
        for k in range(10):
            V.append(str(i)+str(j)+str(k))

for v in V:
    for a in range(N):
        if S[a]==v[0]:
            for b in range(a+1, N):
                if S[b]==v[1]:
                    for c in range(b+1, N):
                        if S[c]==v[2]:
                            s.add(v)
                            break
                    break
            break
print(len(s))
Buggy python submission (verdict: Runtime Error):
def devide2two(n):
    arr=[]
    arr.append((n-1))
    for i in range(2, int(-(-n**0.5//1))+1):
        if n%i==0:
            a = n/i
            arr.append(i-1+ a-1)
    
    return min(arr)
n = input()
print(devide2two(n))

Fixed submission:
def devide2two(n):
    arr=[]
    arr.append((n-1))
    for i in range(2, int(-(-n**0.5//1))+1):
        if n%i==0:
            a = n/i
            arr.append(i-1+ a-1)
    
    return min(arr)
n = int(input())
print(int(devide2two(n)))
Buggy python submission (verdict: Runtime Error):
A, B = list(map(int, input().split()))
if A<2*B:
  print(O)
else:
  print(A-2*B)

Fixed submission:
A, B = list(map(int,input().split()))
if A<2*B:
  print(0)
else:
  print(A-2*B)
Buggy python submission (verdict: Runtime Error):
N ,K = map(int, input().split())
ans=0
for i in range(N):
  h=int(input())
  if h>=K:
    ans+=1
print(ans)
    


Fixed submission:
N ,K = map(int, input().split())
ans=0
h=list(map(int, input().split()))
for i in range(N):
  if h[i]>=K:
    ans+=1
print(ans)

Buggy python submission (verdict: Runtime Error):
N ,K = map(int, input().split())
ans=0
for i in range(N):
  if int(input())>=K:
    ans+=1
print(ans)
    

Fixed submission:
N ,K = map(int, input().split())
ans=0
h=list(map(int, input().split()))
for i in range(N):
  if h[i]>=K:
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a = list(map(int, input().split()))

def A(N,a):
    b = []
    for i in range(N):
        b.append(a.index(i+1)+1)
    b = ' '.join(map(str, b))
    print(b)  
A(N,a)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))

Buggy python submission (verdict: Runtime Error):
N=int(input())
a = list(map(int, input().split()))
b = []
def A(N,a):
    for i in range(N):
        b.append(a.index(i+1)+1)
    b = ' '.join(map(str, b))
    print(b)  
A(N,a)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append(a.index(i+1)+1)
b = ' '.join(map(str, b))
print(b)  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a = list(map(int, input().split()))
b = []
for i in range(N):
    b.append(a.index(i+1)+1)
b = ' '.join(map(str, b))
print(b)  

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))

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

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))

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

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=[0]*n
for i in range(n):
  b[a[i]-1]=str(i+1)
print(" ".join(b))
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    N, K, Q = list(map(int, input().split()))
    S =[K]*N
    s = [1]*N
    for i in range(Q):
        A = int(input())-1
        S = [S[j] - s[j] if j != A else S[j] for j in range(N)]
    for i in range(N):
        if S[i]<1:
            print('No')
        else:
            print('Yes')

if __name__ == '__main__':
    main()

Fixed submission:
def main():
    N, K, Q = list(map(int, input().split()))
    S =[K-Q]*N
    A=[]
    for i in range(Q):
        A.append(int(input())-1)
    for i in A:
        S[i] = S[i]+1
    for i in range(N):
        if S[i]<1:
            print('No')
        else:
            print('Yes')
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = list(map(int, input().split()))
S =[K]*N
s = [1]*N
for i in range(Q):
    A = int(input())-1
    S = [S[j] - s[j] if j != A else S[j] for j in range(N)]
for i in range(N):
    if S[i]<1:
        print('No')
    else:
        print('Yes')

Fixed submission:
def main():
    N, K, Q = list(map(int, input().split()))
    S =[K-Q]*N
    A=[]
    for i in range(Q):
        A.append(int(input())-1)
    for i in A:
        S[i] = S[i]+1
    for i in range(N):
        if S[i]<1:
            print('No')
        else:
            print('Yes')
if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
N, K, Q = list(map(int, input().split()))
S =[K]*N
s = [1]*N
for i in range(Q):
    A = int(input())-1
    S = [S[j] - s[j] if j != A else S[j] for j in range(N)]
for i in range(N):
    if S[i]<1:
        print('No')
    else:
        print('Yes')

Fixed submission:
def main():
    N, K, Q = list(map(int, input().split()))
    S =[K-Q]*N
    A=[]
    for i in range(Q):
        A.append(int(input())-1)
    for i in A:
        S[i] = S[i]+1
    for i in range(N):
        if S[i]<1:
            print('No')
        else:
            print('Yes')
if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import heapq
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
A =[-i for i in A]
heapq.heapify(A)
for i in range(M):
    A[0] = -(-A[0]//2)
    heapq.heapify(A)
print(-1*sum(A))

Fixed submission:
import heapq
N,M = list(map(int, input().split()))
A = list(map(int, input().split()))
A =[-i for i in A]
heapq.heapify(A)
for i in range(M):
    minA = heapq.heappop(A)
    heapq.heappush(A, -(-minA//2))
print(-1*sum(A))
Buggy python submission (verdict: Runtime Error):
N = int(input())
d = len(str(N))
if d==1:
    print(N)
elif d==2:
    print(9)
elif d==3:
    print(9+N-99)
elif d==4:
    print(909)
elif d==5:
    print(909+n-9999)
elif d==6:
    print(90909)

Fixed submission:
N = int(input())
d = len(str(N))
if d==1:
    print(N)
elif d==2:
    print(9)
elif d==3:
    print(9+N-99)
elif d==4:
    print(909)
elif d==5:
    print(909+N-9999)
elif d==6:
    print(90909)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
if A*N>=B:
  print(b)
else:
  print(A*N)

Fixed submission:
N, A, B = map(int, input().split())
if A*N>=B:
  print(B)
else:
  print(A*N)
Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 
nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(int(ans))

Fixed submission:
from fractions import gcd
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 
nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 
nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(int(ans))

Fixed submission:
from fractions import gcd
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 
nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(int(ans))

Buggy python submission (verdict: Runtime Error):
import math
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // math.gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 

nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(ans)

Fixed submission:
from fractions import gcd
A,B,C,D = list(map(int, input().split()))
def lcm(x, y):
    return (x * y) // gcd(x, y)
lcm = lcm(C,D)
nbc = B//C
nbd = B//D
nbl = B//lcm 
nac = (A-1)//C
nad = (A-1)//D
nal = (A-1)//lcm 
ans = B - A + 1-((nbc+nbd-nbl)-(nac+nad-nal))
print(int(ans))
Buggy python submission (verdict: Runtime Error):
N,X= map(int, input().split())
L=list(map(int, input().split()))
D, ans=0, 0
for i in range(N+1):
    if D<=X:
        D+=L[i]
        ans+=1
    else:
        break
print(ans)

Fixed submission:
N,X= map(int, input().split())
L=list(map(int, input().split()))
D, ans=0, 0
for i in range(N):
    if D<=X:
        ans+=1
        D+=L[i]
    else:
        break
if D<=X:
    ans+=1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, M = list(map(int, input().split()))
for i in range(M):
    if i==0:
        L, R = list(map(int, input().split()))
        s = set(range(L,R+1))
        S = s
    else:
        L, R = list(map(int, input().split()))
        s = set(range(L,R+1))
        S = S & s
print(len(S))

Fixed submission:
N, M = list(map(int, input().split()))
f = 0
for i in range(M):
    if i==0:
        L1, R1 = list(map(int, input().split()))
    else:
        L2, R2 = list(map(int, input().split()))
        if R1 < L2 or L1 > R2:
            print(0)
            f+=1
            break
        elif L2<L1 and R1<R2:
            continue
        elif L1<L2 and R2<R1:
            L1 = L2
            R1 = R2
        elif L2<L1 and R2<R1:
            R1 = R2
        elif L1<L2 and R1<R2:
            L1 = L2
        else:
            continue
s = set(range(L1,R1+1))
if f!=1:
    print(len(s))
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = list(input().split())
S[K-1] = S[K-1].lower()
print("".join(S))

Fixed submission:
N, K = map(int, input().split())
S = list(input())
S[K-1] = S[K-1].lower()
print("".join(S))
Buggy python submission (verdict: Runtime Error):
s = input().split()

s_1 = sorted(s)

s_2 = sorted([s_1[0], s_1[1]-1])

A = s_1[1] + s_2[1]

print(A)

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

s_1 = sorted(s)
s_2 = sorted([s_1[0], s_1[1]-1])
A = s_1[1] + s_2[1]
 
print(A)
Buggy python submission (verdict: Runtime Error):
input_a = input()

if input_a[0]　!= 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') ==1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.strip("A").strip('C').islower():
        print('AC')
    else:
        print('WA')

Fixed submission:
input_a = input()
if input_a[0] != 'A':
    print("WA")
elif input_a.count('C')==0:
    print("WA")
elif input_a.count('C')>1:
    print("WA")
elif input_a.index('C') <=1:
    print("WA")
elif input_a.index('C') ==len(input_a)-1:
    print('WA')
elif input_a.count('C') ==1:
    if input_a.replace('A','a').replace('C','c').islower():
        print('AC')
    else:
        print('WA')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A=[]
l=[1]
ans=0
for i in range(N):
    A.append(int(input()))
for i in range(N):
    l.append(A[l[i]-1])
    if l[i+1]==2:
        ans=i+1
        break
    if l[i+1]in l[:i]:
        break
if ans!=0:
    print(ans)
else:
    print(-1)

Fixed submission:
N = int(input())
A=[]
l=[1]
ans=0
for i in range(N):
    A.append(int(input()))
for i in range(N):
    l.append(A[l[i]-1])
    if l[i+1]==2:
        ans=i+1
        break
if ans!=0:
    print(ans)
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

N, K, L = map(int, input().split())
edge1 = [[] for _ in range(N)]
edge2 = [[] for _ in range(N)]

for _ in range(K):
    p, q = map(int, sys.stdin.readline().split())
    edge1[p-1].append(q-1)
    edge1[q-1].append(p-1)

for _ in range(L):
    p, q = map(int, sys.stdin.readline().split())
    edge2[p-1].append(q-1)
    edge2[q-1].append(p-1)


def dfs(edges):
    groups = [-1]*N

    for i in range(N):
        if groups[i] != -1:
            continue

        groups[i] = i
        stack = [i]
        while stack:
            v = stack.pop()
            for dest in edges[v]:
                if groups[dest] != -1:
                    continue
                groups[dest] = i
                stack.append(dest)

    return groups


g1, g2 = dfs(edge1), dfs(edge2)
d = Counter()
for i in range(N):
    d[(g1[i], g2[i])] += 1

print(*(d[(g1[i], g2[i])] for i in range(N)))


Fixed submission:
import sys

s = input()
s = s[::-1]

d ='maerd'
dr = 'remaerd'
e = 'esare'
er = 'resare'

i = 0
while True:
    try:
        if s[i:i+5] == d or s[i:i+5] == e:
            i += 5
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+6] == er:
            i += 6
            if i == len(s):
                print('YES')
                sys.exit(0)
        
        elif s[i:i+7] == dr:
            i += 7
            if i == len(s):
                print('YES')
                sys.exit(0)
            
        else:
            print('NO')
            sys.exit(0)
            
    except Exception as err:
        print('NO')
        sys.exit(0)
Buggy python submission (verdict: Runtime Error):
import math
a,b,h,m=map(int,input().split())
m_=6*m
h_=30*h
if h>6:
    h_op=h-6
elif h<6:
    h_op=h+6
else:
    h_op=12
if m/5<h_op and m/5>h:
    radians=m_-h_
elif m/5<h_op and m/5<h:
    radians=m_-h_+360
elif m/5>h_op and m/5>h:
    radians=h_-m_+360
elif m/5>h_op and m/5<h:
    radians=h_-m_
degree=math.radians(radians)
out=math.sqrt(pow(a,2)+pow(b,2)-2*a*b*math.cos(degree))
print(out)

Fixed submission:
import math
tempList = tuple(map(int, input().split()))
a = tempList[0]
b = tempList[1]
hour = tempList[2]
minute = tempList[3]
time = hour * 60 + minute
mypi = math.pi
hourAngle = time/(12*60)
minuteAngle = minute/60
diff = abs(hourAngle - minuteAngle)
if diff > 0.5:
    diff = 1 - diff
angle = diff * mypi * 2
result = a*a + b*b - 2*a*b*math.cos(angle)
print(math.sqrt(result))
Buggy python submission (verdict: Runtime Error):





i = input()
out = input()
n = 1

while (int(i)*n-(n-1)) < int(out):
    n += 1

else:
    print(n)



Fixed submission:





inp = input().split()
for a in inp:
    out = int(a)
inp.pop(1)
for a in inp:
    i = int(a)
    
n = 1
while (i*n-(n-1)) < out:
    n += 1

else:
    if out == 1:
        print(0)
    else:
        print(n)