Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")


Fixed submission:
x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif x=="C":
  b=12
elif x=="D":
  b=13
elif x=="E":
  b=14
elif x=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")


Fixed submission:
x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13:
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif x=="C":
  b=12
elif x=="D":
  b=13
elif x=="E":
  b=14
elif x=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")


Fixed submission:
x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")

Buggy python submission (verdict: Runtime Error):
x,y = map(int, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13:
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif x=="C":
  b=12
elif x=="D":
  b=13:
elif x=="E":
  b=14
elif x=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")

Fixed submission:
x,y = map(str, input().split())
a=0
b=0
if x=="A":
  a=10
elif x=="B":
  a=11
elif x=="C":
  a=12
elif x=="D":
  a=13
elif x=="E":
  a=14
elif x=="F":
  a=15
  
  
if y=="A":
  b=10
elif y=="B":
  b=11
elif y=="C":
  b=12
elif y=="D":
  b=13
elif y=="E":
  b=14
elif y=="F":
  b=15

if a<b:
  print("<")
elif a>b:
  print(">")
elif a==b:
  print("=")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(str, input().split())
d,e,f = map(str, input().split())
if c==d and a==f and b==e:
  print("YES")
else:
  print("NO")

Fixed submission:
a = input()
b = input()
if a[2]==b[0] and a[0]==b[2] and a[1]==b[1]:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
d,e,f = map(int, input().split())
if c==d and a==f:
  print("YES")
else:
  print("NO")

Fixed submission:
a = input()
b = input()
if a[2]==b[0] and a[0]==b[2] and a[1]==b[1]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
a = input()
if a.count(9)==1 or a.count(9)==2:
  print("Yes")
else:
  print("No")



Fixed submission:
a = str(input())
if a.count("9")==1 or a.count("9")==2:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
listA = ["a","b","c","d","e","f","g","h","i","j","k",
         "l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(27):
  if s.count(listA[i])==0:
    print(listA[i])
    break

Fixed submission:
s = input()
x=0
listA = ["a","b","c","d","e","f","g","h","i","j","k",
         "l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
for i in range(26):
  if s.count(listA[i])==0:
    print(listA[i])
    x=1
    break
if x==0:
  print("None")
Buggy python submission (verdict: Runtime Error):
a = input()
if a[0]==a[3]:
  print("Yes")
else:
  print("No")


Fixed submission:
a = input()
if a[0]==a[2]:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
a = int(input())
if a[0]==a[3]:
  print("Yes")
else:
  print("No")

Fixed submission:
a = input()
if a[0]==a[2]:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
if a%3=0 or b%3=0 or (a+b)%3=0:
  print("Possible")
else:
  print("Impossible")

Fixed submission:
a,b = map(int, input().split())
if a%3==0 or b%3==0 or (a+b)%3==0:
  print("Possible")
else:
  print("Impossible")
Buggy python submission (verdict: Runtime Error):
s = input()
a=0
b=0
def sakana():
  for j in range(len(s)//2):
    if s[j] != s[(len(s)//2)+j]:
      break
    else:
      a=a+1
  if a==len(s)//2:
    return 0
  else:
    return 1

for i in range(len(s)):
  s.rstrip(s[-1])
  if len(s)%2==0 and sakana()==0:
    break
  else:
    b=b+1
print(len(s)-b-1)
    


Fixed submission:
s = input()
t=s
b=0
def sakana(sak, u):
  a=0
  for j in range(len(u)//2):
    if u[j] != u[(len(u)//2)+j]:
      break
    else:
      a=a+1
  if a==len(u)//2:
    return 0
  else:
    return 1

for i in range(len(t)):
  s=s[:-1]
  if len(s)%2==0 and sakana(i, s)==0:
    break
  else:
    b=b+1
print(len(t)-b-1)
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
if c-d<=0:
  print("delicious")
elif c-d>0 and c-d<=x:
  print("safe")
elif c-d>0 and c-d>x:
  print("dangerous")

Fixed submission:
a,b,c = map(int, input().split())
if c-b<=0:
  print("delicious")
elif c-b>0 and c-b<=a:
  print("safe")
elif c-b>0 and c-b>a:
  print("dangerous")
Buggy python submission (verdict: Runtime Error):
n = int(input())
listA = [int(input()) for i in range(n)]
a = listA[0]
b = 0
for j in range(n):
  if a != 2:
    a = listA[a]
    b = b+1
  elif a == 2:
    b = b+1
    break
if b == n:
  print(-1)
else:
  print(b)

  

Fixed submission:
n = int(input())
listA = [int(input()) for i in range(n)]
a = listA[0]
b = 0
for j in range(n):
  if a != 2:
    a = listA[a-1]
    b = b+1
  elif a == 2:
    b = b+1
    break
if b == n:
  print(-1)
else:
  print(b)
Buggy python submission (verdict: Runtime Error):
s = input()
a = 0
for i in range(len(s)):
  a = a + s.count(s[i])
if a = len(s):
  print("yes")
else:
  print("no")

Fixed submission:
s = input()
a = 0
for i in range(len(s)):
  a = a + s.count(s[i])
if a == len(s):
  print("yes")
else:
  print("no")
Buggy python submission (verdict: Runtime Error):
a,b = map(int, input().split())
c = 0
d = 0
e = [1,3,5,7,8,10,12]
f = [4,6,9,11]
g = [2]
for i in e:
  if i==a:
    c = x
  if i==b:
    d = x
for j in f:
  if j==a:
    c = y
  if j==b:
    d = y
if c==d or a==b:
  print("Yes")
else:
  print("No")
  
    

Fixed submission:
a,b = map(int, input().split())
c = 0
d = 0
e = [1,3,5,7,8,10,12]
f = [4,6,9,11]
g = [2]
for i in e:
  if i==a:
    c = "x"
  if i==b:
    d = "x"
for j in f:
  if j==a:
    c = "y"
  if j==b:
    d = "y"
if c==d or a==b:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())
listA = [(map(int, input().split())) for i in range(m)]
for j in range(n):
  print(count(j+1))


Fixed submission:
n,m = map(int, input().split())
listA = [list(map(int, input().split())) for i in range(m)]

for j in range(n):
  a = 0
  for k in range(m):
    a = a + listA[k].count(j+1)
  print(a)
Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = ""
for i in range(len(a)):
  c = c + a[i] + b[i]
if len(a)>len(b):
  c = c + a[len(a)]
print(c)
  

Fixed submission:
a = input()
b = input()
c = ""
for i in range(len(b)):
  c = c + a[i] + b[i]
if len(a)>len(b):
  c = c + a[len(a)-1]
print(c)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
listA = [list(map(int, list(input()))) for i in range(n)]
listB = [list(map(int, list(input()))) for j in range(m)]
listC=[]
for k in range(n):
  for l in range(m):
    listC.append(abs(listA[k][0]-listB[l][0])+abs(list[k][1]-listB[l][1]))
  listC.sort()
  print(listC[0])


Fixed submission:
n,m = map(int,input().split())
listA = [list(map(int, input().split())) for i in range(n)]
listB = [list(map(int, input().split())) for j in range(m)]
listC=[]

for k in range(n):
  b=0
  c=0
  for l in range(m):
    a=abs(listA[k][0]-listB[l][0])+abs(listA[k][1]-listB[l][1])
    if a<b or l==0:
      b=a
      c=l
  print(c+1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
k = 1
for i in range(1,n+1):
  k = k*i
print(k%(10**9+7))


Fixed submission:
n = int(input())
k = 1
for i in range(1,n+1):
  k = k*i%(10**9+7)
print(k)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
k = 1
for i in range(1,n+1):
  k = k*i
print(k%(10**9+7))


Fixed submission:
n = int(input())
k = 1
for i in range(1,n+1):
  k = k*i%(10**9+7)
print(k)
Buggy python submission (verdict: Runtime Error):
n = int(input())
listA = list(map(int, input().split()))
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(1,m+1):
  x=listA[listB[i][0]]
  listA[listB[i][0]] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]]=x

Fixed submission:
n = int(input())
listA = list(map(int, input().split()))
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(m):
  x=listA[listB[i][0]-1]
  listA[listB[i][0]-1] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]-1]=x

Buggy python submission (verdict: Runtime Error):
n = int(input())
listA = list(int, input().split())
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(1,m+1):
  x=listA[listB[i][0]]
  listA[listB[i][0]] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]]=x

    

Fixed submission:
n = int(input())
listA = list(map(int, input().split()))
m = int(input())
listB = []
while True:
  try:
    listB.append(list(map(int,input().split())))
  except:
    break;
for i in range(m):
  x=listA[listB[i][0]-1]
  listA[listB[i][0]-1] = listB[i][1]
  s=0
  for j in range(n):
    s = s+listA[j]
  print(s)
  listA[listB[i][0]-1]=x
Buggy python submission (verdict: Runtime Error):
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i-1]\nlistA[i-1])


Fixed submission:
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i]+"\n"+listA[i])

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


Fixed submission:
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i]+"\n"+listA[i])

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


Fixed submission:
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i]+"\n"+listA[i])

Buggy python submission (verdict: Runtime Error):
h,w = map(int, input().split())
listA = []
while True:
  try:
    listA.append(list(map(int,input().split())))
  except:
    break;
for i in range(n):
  print(listA[i-1]"\n"listA[i-1])

Fixed submission:
h,w = map(int, input().split())
listA = [input() for i in range(h)]
for i in range(h):
  print(listA[i]+"\n"+listA[i])
Buggy python submission (verdict: Runtime Error):
a,b,c = map(str, input().split())
d = b.split("")
e = d[0]
print("A"+e+"C")

Fixed submission:
a,b,c = map(str, input().split())
d = b[0]
print("A"+d+"C")
Buggy python submission (verdict: Runtime Error):
a,b,x = map(int, input().split())
c = int((a-1)/x)
d = int(b/x)
if a!=0:
  print(d-c)
elif a==0:
  print(d)



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

ans = int(b // x) - int((a - 1) // x)

print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,x = map(int, input().split())
if a!=0:
  c = int((a-1)/x)
  d = int(b/x)
if a!=0:
  print(d-c)
elif a==0:
  print(d)


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

ans = int(b // x) - int((a - 1) // x)

print(ans)

Buggy python submission (verdict: Runtime Error):
a,b,x = map(int, input().split())
if a!=0:
c = int((a-1)/x)
d = int(b/x)
if a!=0:
  print(d-c)
elif a==0:
  print(d)

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

ans = int(b // x) - int((a - 1) // x)

print(ans)
Buggy python submission (verdict: Runtime Error):
a = input()
b = 0
for i in len(a):
  if a.count(a[i])%2!=0:
    print("No")
    b = 1
    break
if b==0:
  print("Yes")
  
    

Fixed submission:
a = input()
b = 0
for i in range(len(a)):
  if a.count(a[i])%2!=0:
    print("No")
    b = 1
    break
if b==0:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
n = int(input())
k = 0
for i range(:n+1):
  k += i

Fixed submission:
n = int(input())
k = 0
for i in range(n+1):
  k += i
print(k)
Buggy python submission (verdict: Runtime Error):
n,l = map(int, input().split())
a = [input() for i in range(n)]
b = sorted(a)
k = ""
for j in range(n):
  k = k+b[j]
print(k)

Fixed submission:
a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n,l = map(int, input().split())
a = [input() for i in range(n)]
b = sorted(a)
k = ""
for j in range(n):
  k = k+b[j]
print(k)

Fixed submission:
a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a = input()
if a.count(5)==2 and a.count(7)==1:
    print("Yes")
else:
    print("No")

Fixed submission:
a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
a = list(map(int, input().split()))
if a.count(5)==2 and a.count(7)=1:
    print("Yes")
else:
    print("No")

Fixed submission:
a = list(map(int, input().split()))
b = a.count(5)
c = a.count(7)
if b==2 and c==1:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
n,l = map(int, input().split())
a = [input() for i in range(n)]
a.sorted()
k = ""
for j in range(n):
  k = k+a[j]
print(k)
  

Fixed submission:
n,l = map(int, input().split())
a = [input() for i in range(n)]
b = sorted(a)
k = ""
for j in range(n):
  k = k+b[j]
print(k)
Buggy python submission (verdict: Time Limit Exceeded):
n, a, b = map(int,(input().split()))

ans = 0

while n >= a+b:
    ans = ans + a
    n = n - (a+b)

if n >= a:
    ans = ans + a
else:
    ans = ans + n

print(ans)



Fixed submission:
n, a, b = map(int,(input().split()))
c = int(n/(a+b))
ans = c*a

d = n-c*(a+b)
if d >= a:
    ans = ans + a
else:
    ans = ans + d

print(ans)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(input())

cnt = 0
for i in range(n):
    if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
        cnt += 1
    else:
        pass
    
print(cnt)

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

cnt = 0
for i in range(n-2):
    if s[i] == "A" and s[i+1] == "B" and s[i+2] == "C":
        cnt += 1
    else:
        pass
    
print(cnt)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
N = int(input())
xy = [tuple(map(int,input().split())) for i in range(N)]
ct = Counter()
for i in range(N):
  for j in range(i+1,N):
    dx = xy[i][0]-xy[j][0]
    dy = xy[i][1]-xy[j][1]
    ct[(dx,dy)] += 1
print(N-max(ct.values()))

Fixed submission:
from collections import Counter
N = int(input())
xy = [tuple(map(int,input().split())) for i in range(N)]
ct = Counter()
for i in range(N):
  for j in range(i+1,N):
    dx = xy[i][0]-xy[j][0]
    dy = xy[i][1]-xy[j][1]
    ct[(dx,dy)] += 1
    ct[(-dx,-dy)] += 1
print(N-max(ct.values() if len(ct)>0 else [0]))
Buggy python submission (verdict: Runtime Error):
d = 1000000007
N, M = list(map(int, input().split()))
a = [int(input()) for i in range(M)]
safe = [True for i in range(N+1)]
for ai in a:
  safe[ai] = False
dp = [0 for i in range(N+1)]
dp[1] = 1 if safe[1] else 0
dp[2] = 1+dp[1] if safe[2] else 0
for i in range(3, N+1):
  dp[i] = (dp[i-2]+dp[i-1]) % d if safe[i] else 0
print(dp[N])

Fixed submission:
d = 1000000007
N, M = list(map(int, input().split()))
a = [int(input()) for i in range(M)]
safe = [True for i in range(N+1)]
for ai in a:
  safe[ai] = False
dp = [0 for i in range(N+1)]
dp[0] = 1
dp[1] = 1 if safe[1] else 0
for i in range(2, N+1):
  dp[i] = (dp[i-2]+dp[i-1]) % d if safe[i] else 0
print(dp[N])
Buggy python submission (verdict: Time Limit Exceeded):
def t(d, a, r, i, c):
  if r[i]!=-1:
    return
  r[i]=c
  for aj in a[i]:
    t(d, a, r, aj, (c+d[i][aj])%2)

N, = list(map(int, input().split()))
d = []
for i in range(N):
  d.append([-1 for j in range(N)])
a = [[] for i in range(N)]
for i in range(N-1):
  u, v, w = list(map(int, input().split()))
  u -= 1
  v -= 1
  d[u][v] = w%2
  d[v][u] = w%2
  a[u].append(v)
  a[v].append(u)
r = [-1 for i in range(N)]
t(d, a, r, 0, 0)
for i in range(N):
  print(r[i])

Fixed submission:
N, = list(map(int, input().split()))
a = [{} for i in range(N)]
for i in range(N-1):
  u, v, w = list(map(int, input().split()))
  u -= 1
  v -= 1
  a[u][v] = w%2
  a[v][u] = w%2
r = [-1 for i in range(N)]
r[0] = 0
q = [0]
while q:
  i = q.pop(0)
  for aj in a[i].keys():
    if r[aj]==-1:
      r[aj] = (r[i]+a[i][aj])%2
      q.append(aj)
for i in range(N):
  print(r[i])

Buggy python submission (verdict: Time Limit Exceeded):
def t(d, a, r, i, c):
  if r[i]!=-1:
    return
  r[i]=c
  for aj in a[i]:
    t(d, a, r, aj, (c+d[i][aj])%2)

N, = list(map(int, input().split()))
d = []
for i in range(N):
  d.append([-1 for j in range(N)])
a = [[] for i in range(N)]
for i in range(N-1):
  u, v, w = list(map(int, input().split()))
  u -= 1
  v -= 1
  d[u][v] = w%2
  d[v][u] = w%2
  a[u].append(v)
  a[v].append(u)
r = [-1 for i in range(N)]
t(d, a, r, 0, 0)
for i in range(N):
  print(r[i])

Fixed submission:
N, = list(map(int, input().split()))
a = [{} for i in range(N)]
for i in range(N-1):
  u, v, w = list(map(int, input().split()))
  u -= 1
  v -= 1
  a[u][v] = w%2
  a[v][u] = w%2
r = [-1 for i in range(N)]
r[0] = 0
q = [0]
while q:
  i = q.pop(0)
  for aj in a[i].keys():
    if r[aj]==-1:
      r[aj] = (r[i]+a[i][aj])%2
      q.append(aj)
for i in range(N):
  print(r[i])
Buggy python submission (verdict: Time Limit Exceeded):
R,G,B,N, = list(map(int,input().split()))
s = 0
for r in range(N+1):
    for g in range(N+1):
        bp = N-r*R-g*G
        if bp>=0 and bp%B==0:
            s += 1
print(s)

Fixed submission:
R,G,B,N, = list(map(int,input().split()))
s = 0
for r in range(N+1):
    for g in range(N+1):
        bp = N-r*R-g*G
        if bp>=0 and bp%B==0:
            s += 1
print(s)
Buggy python submission (verdict: Runtime Error):
N,T=map(int,raw_input().split())
mc=9999
for i in range(N):
  c,t=map(int,raw_input().split())
  if t<=T:
    mc=min(mc,c)
print mc==9999?"TLE":mc

Fixed submission:
N,T=map(int,raw_input().split())
mc=9999
for i in range(N):
  c,t=map(int,raw_input().split())
  if t<=T:
    mc=min(mc,c)
print "TLE" if mc==9999 else mc
Buggy python submission (verdict: Runtime Error):
N = int(raw_input())
A = map(int, raw_input().split())
m = 0
for i in range(N):
  for j in range(N):
    m = max(m, abs(A[i]-A[j])
print m

Fixed submission:
N = int(raw_input())
A = map(int, raw_input().split())
m = 0
for i in range(N):
  for j in range(N):
    m = max(m, abs(A[i]-A[j]))
print m
Buggy python submission (verdict: Time Limit Exceeded):
import itertools
N, M, R = map(int, raw_input().split())
r = [int(x)-1 for x in raw_input().split()]
D = []
for i in range(N):
  D.append([200000000]*N)
  D[i][i]=0
A = [0]*M
B = [0]*M
C = [0]*M
for i in range(M):
  a, b, C[i] = map(int, raw_input().split())
  A[i] = a-1
  B[i] = b-1
  D[A[i]][B[i]] = C[i]
  D[B[i]][A[i]] = C[i]
for k in range(N):
  for i in range(N):
    for j in range(N):
      D[i][j] = min(D[i][j], D[i][k]+D[k][j])
ml = 2000000000
for p in itertools.permutations(r):
  l = 0
  for i in range(R-1):
    l += D[p[i]][p[i+1]]
  ml = min(ml, l)
print ml

Fixed submission:
import itertools
N, M, R = map(int, raw_input().split())
r = [int(x)-1 for x in raw_input().split()]
D = []
for i in range(N):
  D.append([200000000]*N)
  D[i][i]=0
A = [0]*M
B = [0]*M
C = [0]*M
for i in range(M):
  a, b, C[i] = map(int, raw_input().split())
  A[i] = a-1
  B[i] = b-1
  D[A[i]][B[i]] = C[i]
  D[B[i]][A[i]] = C[i]
for k in range(N):
  for i in range(N):
    for j in range(N):
      D[i][j] = min(D[i][j], D[i][k]+D[k][j])
ml = 2000000000
for p in itertools.permutations(r):
  l = 0
  for i in range(R-1):
    l += D[p[i]][p[i+1]]
  ml = min(ml, l)
print ml
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
  m = max(a, b)
  n = max(a, b)
  if n==0:
    return m
  else:
    return gcd(n, m%n)

N = int(input())
l = 1
for i in range(N):
  t = int(input())
  g = gcd(l, t)
  l *= t//g
print(l)

Fixed submission:
def gcd(a, b):
  m = max(a, b)
  n = min(a, b)
  if n==0:
    return m
  else:
    return gcd(n, m%n)
 
N = int(input())
l = 1
for i in range(N):
  t = int(input())
  g = gcd(l, t)
  l *= t//g
print(l)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
m = {}
for i in range(N):
  ti = int(raw_input())
  pi = {}
  x = 2
  while x*x <= ti:
    while ti % x == 0:
      ti /= x
      pi[x] = pi.get(x,0)+1
    x += 1
  if ti > 1:
    pi[ti] = pi.get(ti,0)+1
  for x in pi.keys():
    m[x] = max(m.get(x,0), pi[x])
ret = 1
for x in m.keys():
  ret *= x**m[x]
print ret

Fixed submission:
def gcd(a, b):
  m = max(a, b)
  n = min(a, b)
  if n==0:
    return m
  else:
    return gcd(n, m%n)
 
N = int(input())
l = 1
for i in range(N):
  t = int(input())
  g = gcd(l, t)
  l *= t//g
print(l)
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
G = [[0]*N for i in range(N)]
for i in range(N-1):
  a, b, c = map(int, raw_input().split())
  G[a-1][b-1] = G[b-1][a-1] = c
Q, K = map(int, raw_input().split())
K -= 1

d = [0]*N
p = [K]
while len(p)>0:
  v = p.pop()
  for n in range(N):
    if n!=K and d[n]==0 and G[v][n]>0:
      d[n] = d[v]+G[v][n]
      p.append(n)

for i in range(Q):
  x, y = map(int, raw_input().split())
  print d[x-1]+d[y-1]

Fixed submission:
N = int(raw_input())
G = {}
for i in range(N):
  G[i] = {}
for i in range(N-1):
  a, b, c = map(int, raw_input().split())
  G[a-1][b-1] = G[b-1][a-1] = c
Q, K = map(int, raw_input().split())
K -= 1

d = [0]*N
p = [K]
while len(p)>0:
  v = p.pop()
  for n in G[v].keys():
    if n!=K and d[n]==0:
      d[n] = d[v]+G[v][n]
      p.append(n)

for i in range(Q):
  x, y = map(int, raw_input().split())
  print d[x-1]+d[y-1]