Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
lenghts = int(input())
document = input()

count = 0
for start in range(lenghts -2):
  if document[start: start+3] == 'ABC':
    count += 1
  
print(count)

Fixed submission:
input_line = input()
Line = input_line.split()
if 500*int(Line[0]) >= int(Line[1]):
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    result = True
    used = {str(input()): 0}
    for order in range(1,n):
        word = str(input())
        if word in used or list(used.keys())[order - 1][-1] != word[0]:
            result = False
            break
        else:
            used.setdefault(word,0)
    print("Yes" if result else "No")
        
if __name__ == "__main__":
    main()

Fixed submission:
def main():
  A, B = map(int, input().split())
  print('Yes'if (A * B)**2 % 2 == 1 else 'No')
 
 
if __name__ == "__main__":
  main()

Buggy python submission (verdict: Runtime Error):
def main():
    n = int(input())
    result = True
    used = {str(input()): 0}
    for order in range(1,n):
        word = str(input())
        if word in used or sorted(used.keys())[order - 1][-1] != word[0]:
            print('NO')
            result = False
            break
        else:
            used.setdefault(word,0)
    if result:
        print('Yes')
        
if __name__ == "__main__":
    main()

Fixed submission:
def main():
  A, B = map(int, input().split())
  print('Yes'if (A * B)**2 % 2 == 1 else 'No')
 
 
if __name__ == "__main__":
  main()
Buggy python submission (verdict: Runtime Error):
n = input()
s = input()

if int(n) >= 3 and int(n) =< 50:
    print(s.count('ABC'))

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

print(s.count('ABC'))
Buggy python submission (verdict: Runtime Error):
# _*_ coding:utf-8 _*_

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(f'{c}')
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='') 

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

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(c)
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='')

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

import sys

input = sys.stdin.readline()
ans  = 1000

for c in input:
	s = input.split(f'{c}')
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans) 

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

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(c)
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='')

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

import sys

input = sys.stdin.readline()
ans  = 1000

for c in input:
	s = input.split(f'{c}')
	max = 0
	for i in range(len(s)):
		if max < len(s[i]):
			max = len(s[i])
	
	if ans > max:
		ans = max
		
print(ans) 

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

import sys

input = sys.stdin.readline().replace('\n','')
ans  = 1000

for c in input:
	s = input.split(c)
	ma = 0
	for i in range(len(s)):
		if ma < len(s[i]):
			ma = len(s[i])
	
	if ans > ma:
		ans = ma
		
print(ans,end='')
Buggy python submission (verdict: Runtime Error):
K,X = input().split()

def main(K,X):
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main()


Fixed submission:
K,X = input().split()

def main(K,X):
  K = int(K)
  X = int(X)
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main(K,X)

Buggy python submission (verdict: Runtime Error):
K,X = 2 900

def solve(K,X):
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')

Fixed submission:
K,X = input().split()

def main(K,X):
  K = int(K)
  X = int(X)
  if K * 500 >= X:
    print('Yes')
  else:
    print('No')
 
if __name__ == '__main__':
  main(K,X)
Buggy python submission (verdict: Runtime Error):
from scipy.sparse import*
(N,M,R),r,*t=[map(int,i.split())for i in __import__("sys").stdin]
a,b,c=zip(*t)
l=csgraph.dijkstra(csr_matrix((c,(a,b)),[N+1]*2),0)
print(min(sum(int(l[i][j])for i,j in zip(a[:-1],a[1:]))for a in __import__("itertools").permutations(r)))

Fixed submission:
s=input()
print("Yes" if s/10==9 or s%10==9 else "No")

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

N,M,R = map(int, input().split())
r = map(int, input().split())
l = [[1e9 for i in range(N+1)] for i in range(N+1)]

for i in range(M):
    a,b,c = map(int, input().split())
    l[a][b] = l[b][a] = c

for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            t = l[i][k] + l[k][j]
            if l[i][j] > t: l[i][j] = t

ans = 1e9
for a in itertools.permutations(r):
    s = 0
    for i,j in zip(a[:-1],a[1:]):
        s += l[i][j]
    if ans > s: ans = s

print(ans)


Fixed submission:
s=input()
print("Yes" if s/10==9 or s%10==9 else "No")

Buggy python submission (verdict: Runtime Error):
s=input()
print("Yes" if s/10==9 or s%10==9 else "No")

Fixed submission:
s=input()
print("Yes" if s/10==9 or s%10==9 else "No")
Buggy python submission (verdict: Time Limit Exceeded):
import itertools

N,M,R = map(int, input().split())
r = map(int, input().split())
l = [[1e9 for i in range(N+1)] for i in range(N+1)]

for i in range(M):
    a,b,c = map(int, input().split())
    l[a][b] = l[b][a] = c

for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            t = l[i][k] + l[k][j]
            if l[i][j] > t: l[i][j] = t

ans = 1e9
for a in itertools.permutations(r):
    s = 0
    for i,j in zip(a[:-1],a[1:]):
        s += l[i][j]
    if ans > s: ans = s

print(ans)


Fixed submission:
import itertools

N,M,R = map(int, input().split())
r = map(int, input().split())
l = [[1e9 for i in range(N+1)] for i in range(N+1)]

for i in range(M):
    a,b,c = map(int, input().split())
    l[a][b] = l[b][a] = c

for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            t = l[i][k] + l[k][j]
            if l[i][j] > t: l[i][j] = t

ans = 1e9
for a in itertools.permutations(r):
    s = 0
    for i,j in zip(a[:-1],a[1:]):
        s += l[i][j]
    if ans > s: ans = s

print(ans)

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

N,M,R = map(int, input().split())
r = map(int, input().split())
l = [[1e9 for i in range(N+1)] for i in range(N+1)]

for i in range(M):
    a,b,c = map(int, input().split())
    l[a][b] = l[b][a] = c

for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            t = l[i][k] + l[k][j]
            if l[i][j] > t: l[i][j] = t

ans = 1e9
for a in itertools.permutations(r):
    s = sum(l[i][j] for i,j in zip(a[:-1],a[1:]))
    if ans > s: ans = s

print(ans)


Fixed submission:
import itertools

N,M,R = map(int, input().split())
r = map(int, input().split())
l = [[1e9 for i in range(N+1)] for i in range(N+1)]

for i in range(M):
    a,b,c = map(int, input().split())
    l[a][b] = l[b][a] = c

for k in range(1,N+1):
    for i in range(1,N+1):
        for j in range(1,N+1):
            t = l[i][k] + l[k][j]
            if l[i][j] > t: l[i][j] = t

ans = 1e9
for a in itertools.permutations(r):
    s = 0
    for i,j in zip(a[:-1],a[1:]):
        s += l[i][j]
    if ans > s: ans = s

print(ans)
Buggy python submission (verdict: Runtime Error):
N = int(input())

for i in range(1,10):
    for j in range(1,10):
        if i * j == N:
            print("Yes")
            quit()
print("No")


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

if a > 9 or b > 9:
    print(-1)
else:
    print(a*b)

Buggy python submission (verdict: Runtime Error):
a,b = map(int, input.split())

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

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

if a > 9 or b > 9:
    print(-1)
else:
    print(a*b)
Buggy python submission (verdict: Runtime Error):
import math

N = int(input())
ans = N-1
for i in range(1, math.sqrt(N)+1):
    if N%i==0:
        ans = min(ans, i+(N/i)-2)
print(ans)


Fixed submission:
import math

N = int(input())
ans = N-1
for i in range(1, int(math.sqrt(N)+1)):
    if N%i==0:
        ans = min(ans, i+(N/i)-2)
print(int(ans))
Buggy python submission (verdict: Runtime Error):
a = input()
a.sort()

if a[0]==a[1] and a[2]==a[3] and a[1]!=a[3]:
    print("Yes")
else:
    print("No")

Fixed submission:
a = input()
a = sorted(a)

if a[0] == a[1] and a[2] == a[3] and a[1] != a[3]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a = input().split("\n")[1]
print(a.count("ABC"))

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))

Buggy python submission (verdict: Runtime Error):
a = input().split("¥n")[1]
print(a.count("ABC"))

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))

Buggy python submission (verdict: Runtime Error):
a = input().split("¥n")[1]
print(len(a.split("ABC"))-1)

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))

Buggy python submission (verdict: Runtime Error):
a = input().split("\n")[1]
print(len(a.split("ABC"))-1)

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))

Buggy python submission (verdict: Runtime Error):
a,b=input().split("\n")
print(len(b.split("ABC"))-1)

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))

Buggy python submission (verdict: Runtime Error):
a,b=map(int, input().split("\n"))
print(len(b.split("ABC"))-1)

Fixed submission:
a = input()
a = input()
print(a.count("ABC"))
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

import itertools
X = list(itertools.permutations(range(1,N+1),N))
for i in range(len(X)):
  x = X[i]
  if P == x:
    a = i 
  elif Q == x:
    b = i

print(abs(a-b))

Fixed submission:
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

import itertools
X = list(itertools.permutations(range(1,N+1),N))
for i in range(len(X)):
  x = X[i]
  if P == x:
    a = i 
  if Q == x:
    b = i

print(abs(a-b))
Buggy python submission (verdict: Runtime Error):

def to_bin(n):
  s = ''
  while n > 0:
    s += str(n%2)
    n //= 2
  return s[::-1]

def xor(s1, s2):
  s1 = '0'*(len(s2)-len(s1)) + s1
  result = ''
  for i in range(len(s1)):
    if s1[i] == s2[i]:
      result += '0'
    else:
      result += '1'
  return result

def to_den(s):
  s = s[::-1]
  total = 0
  for i in range(0, len(s)):
    total += 2**i*int(s[i])
  return total

def main():
  A, B = map(int, input().split())
  if A == B:
    print(A)
    exit(1)

  cur = xor(to_bin(A), to_bin(A+1))

  for i in range(A+2, B+1):
    s = to_bin(i)
    cur = xor(cur, s)

  print(to_den(cur))

main()


Fixed submission:
H, W = map(int, input().split())
h,w = map(int, input().split())

print(abs(H-h)*abs(W-w))
Buggy python submission (verdict: Runtime Error):
N, *p = map(int, open(0).read().split())

if sum(p[i] != i + 1 for i in range(N)) <= 2:
    print('YES')
else:
    print('NO')


Fixed submission:
n=int(input())
ans=0
for i in range(1,n+1):
    if len(str(i))%2==1:
        ans+=1
print(ans)
Buggy python submission (verdict: Runtime Error):
 N, *p = map(int, open(0).read().split())

if sum(p[i] != i + 1 for i in range(N)) <= 2:
    print('YES')
else:
    print('NO')


Fixed submission:
N=int(input())
P=list(map(int,input().split()))
w=0
for i in range(N):
	if P[i]!=i+1:
		w+=1
else:
	print("NO" if w>2 else "YES")
Buggy python submission (verdict: Runtime Error):
a,b,t=map(int, input().split())
cnt=0
t+=0.5
for i in range(1,t,a):
    cnt+=b
print(cnt)

Fixed submission:
a,b,t=map(int, input().split())
print(b*(t//a))
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = input()
k = int(input())
for i in s:
    if i == s[k]:
        print(i, end="")
    else:
        print("*", end="")

Fixed submission:
n = int(input())
s = input()
k = int(input())
for i in s:
    if i == s[k-1]:
        print(i, end="")
    else:
        print("*", end="")
Buggy python submission (verdict: Runtime Error):
a,b,c,d,e,k = int(input()) for i in range(6)
print("Yay!" if e - a <= k else ":(")

Fixed submission:
a,b,c,d,e,k = [int(input()) for i in range(6)]
print("Yay!" if abs(a - e) <= k else ":(")
Buggy python submission (verdict: Runtime Error):
s=int(input())
print("Heisei" if s <= "2019/04/30" else "TBD")

Fixed submission:
s=input()
print("Heisei" if s <= "2019/04/30" else "TBD")

Buggy python submission (verdict: Runtime Error):
s=int(input())
print("Heisei" if s =< "2019/04/30" else "TBD")

Fixed submission:
s=input()
print("Heisei" if s <= "2019/04/30" else "TBD")
Buggy python submission (verdict: Runtime Error):
n=int(input())
list=[input() for i in range(n)]
sorted(list)
print(abs(list[-1]-list[0]))

Fixed submission:
s=int(input())
a=list(map(int,input().split()))
print(max(a)-min(a))
Buggy python submission (verdict: Runtime Error):
int(N) = input()
int(A) = input()
if N % 500 > A:
    print("Yes")
else:
    print("No")

Fixed submission:
N = int(input())
A = int(input())
if (N % 500) > A:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split)
if (a*b) % 2:
    print("Odd")
else:
    print("Even")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a * b) % 2　== 0:
    print("Even")
else:
    print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if (a*b) % 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(int().split())
if (a*b) % 0:
  print("Even")
else:
  print("Odd")

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = input().split()
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')


Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a, b = map(intm input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')


Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
c = a * b
if c % 2 == 0：
	print("Even)
else:
	print("Odd")
      

Fixed submission:
a, b = map(int, input().split())
if (a * b) % 2 == 0:
  print('Even')
else:
  print('Odd')
Buggy python submission (verdict: Runtime Error):
import math
a,b = map(int, input().split())
print(math.ceil((a+b)/2a))

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

s.sort()
t.reverse()
t=''.join(t)

if s < t:
    print('Yes')
else:
    print('No')

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

s.sort()
t.reverse()
t=''.join(t)

print(s)
print(t)

if s < t:
    print('Yes')
else:
    print('No')

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

Buggy python submission (verdict: Runtime Error):
import math
a, b = map(int, input().split())
(a + b) / 2 = x
print(ceil(x))

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

Buggy python submission (verdict: Runtime Error):
from math import ceil
a, b = map(int, input().split())
(a + b) / 2 = x
print(ceil(x))

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))

Buggy python submission (verdict: Runtime Error):
from math import ceil
x = (a + b) / 2
print(ceil(x))

Fixed submission:
import math
a,b = map(int, input().split())
x = (a + b) / 2
print(math.ceil(x))
Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

s.sort()
t.reverse()
t=''.join(t)

if s < t:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

t.sort()
t.reverse()
t=''.join(t)

if s < t:
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

t.reverse()
t=''.join(t)

if s =< t:
    print('Yes')
else:
    print('No')

Fixed submission:
s = list(input())
t = list(input())

s.sort()
s=''.join(s)

t.sort()
t.reverse()
t=''.join(t)

if s < t:
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int, input().split())
for i in range(B+1):
    if i*a%b == c:
        print("YES")
    else:
        print("NO")

Fixed submission:
a,b,c = map(int, input().split())
cnt = 0
for i in range(b+1):
    if i*a%b == c:
        cnt =+ 1
        break
    else:
        continue
print("YES" if cnt == 1 else "NO")

Buggy python submission (verdict: Runtime Error):
import math
a,b,c = map(int, input().split())
if c % math.gcd(a, b) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = map(int, input().split())
cnt = 0
for i in range(b+1):
    if i*a%b == c:
        cnt =+ 1
        break
    else:
        continue
print("YES" if cnt == 1 else "NO")

Buggy python submission (verdict: Runtime Error):
import math
a,b,c = map(int, input().split())
if c % math.gcd(a, b) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = map(int, input().split())
cnt = 0
for i in range(b+1):
    if i*a%b == c:
        cnt =+ 1
        break
    else:
        continue
print("YES" if cnt == 1 else "NO")

Buggy python submission (verdict: Runtime Error):
from franctions import gcd
a,b,c = map(int, input().split())
if c % gcd(a, b) == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
a,b,c = map(int, input().split())
cnt = 0
for i in range(b+1):
    if i*a%b == c:
        cnt =+ 1
        break
    else:
        continue
print("YES" if cnt == 1 else "NO")
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().split())
s = sorted([input() for i in n])
print("".join(s))

Fixed submission:
n, l = map(int, input().split())
s = sorted([input() for i in range(n)])
print("".join(s))
Buggy python submission (verdict: Runtime Error):
r,d,x=input().split()
m = int(x)
for i in range(1, 11):
    m = int(r) * int(m) - int(d)
    print(int(m))

Fixed submission:
a,b=input().split()
if int(a) >= 13:
  print(b)
elif int(a) >= 6:
  m = int(b) /  2
  print(int(m))
else:
  print("0")
Buggy python submission (verdict: Runtime Error):
8
9 1 14 5 5 4 4 14

Fixed submission:
K=int(input())
D=[int(x) for x in input().split()]
D.sort()
M=K/2
m=M-1
ans=D[int(M)]-D[int(m)]
print(ans)
Buggy python submission (verdict: Runtime Error):
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N+1):
  distance += L[i]
  if distance >= X:
    print(i+1)
    break

Fixed submission:
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N):
  distance += L[i]
  if distance > X:
    print(i+1)
    break
else: 
  print(N+1)

Buggy python submission (verdict: Runtime Error):
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N+1):
  distance += L[i]
  if distance > X:
    print(i+1)
    break
    

Fixed submission:
N,X = map(int, input().split())
L = list(map(int, input().split()))

distance = 0
for i in range(N):
  distance += L[i]
  if distance > X:
    print(i+1)
    break
else: 
  print(N+1)
Buggy python submission (verdict: Runtime Error):
#標準入力
N = int(input())
S = []
S = [list(map(int, input().split())) for i in range(N)]

ans = 1
i = 0
j = 0
for _ in range(N):
  if i==N:
    break
  try:
    a =(S[i+1][1]-S[i][1])/(S[i+1][0]-S[i][0])
    b = S[i][1]-a*S[i][0]
    for _ in range(N):
      if j == N:
        i = N
        break
      if S[j][1]!=a*S[j][0]+b:
        ans+=1
        break
      else:
        S.remove(S[j])
        N -= 1
      j +=1  
  except:

    for _ in range(N):
      if j == N:
        i = N
        break
      if S[j][0]!=S[i][0]:
        ans+=1
        break
      else: 
        S.remove(S[j])
        N -= 1
      j+=1
    
print(ans)



Fixed submission:
from collections import Counter
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
 
counter = Counter(((b1[0] - b2[0], b1[1] - b2[1])for b1 in xy for b2 in xy if b1 != b2))
print(N - (list(counter.most_common())+[(0,0)])[0][1])

Buggy python submission (verdict: Runtime Error):
#標準入力
N = int(input())
S = []
S = [list(map(int, input().split())) for i in range(N)]

ans = 1
i = 0
j = 0
for _ in range(N):
  if i==N:
    break
  try:
    a =(S[i+1][1]-S[i][1])/(S[i+1][0]-S[i][0])
    b = S[i][1]-a*S[i][0]
    for _ in range(N):
      if j == N:
        i = N
        break
      if S[j][1]!=a*S[j][0]+b:
        ans+=1
        break
      else:
        S.remove(S[j])
        N -= 1
      j +=1  
  except:

    for _ in range(N):
      if j == N:
        i = N
        break
      if S[j][0]!=S[i][0]:
        ans+=1
        i = j
        break
      else: 
        S.remove(S[j])
        N -= 1
      j+=1
    
print(ans)



Fixed submission:
from collections import Counter
N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
 
counter = Counter(((b1[0] - b2[0], b1[1] - b2[1])for b1 in xy for b2 in xy if b1 != b2))
print(N - (list(counter.most_common())+[(0,0)])[0][1])
Buggy python submission (verdict: Runtime Error):
K,X=input().split()
if 500*K >= X:
  print("Yes")
else*
  print("No")


Fixed submission:
K,X=map(int,input().split())
if 500*K >= X:
  print("Yes")
else:
  print("No")

Buggy python submission (verdict: Runtime Error):
X,K=input().split()
if 500*X >= K:
  print("Yes")
else*
  print("No")

Fixed submission:
K,X=map(int,input().split())
if 500*K >= X:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
n = int(input())
if n == 1:
  print('Hello World')
else:
  a,b=map(int,input().split())
  print(a+b)

Fixed submission:
n = int(input())
if n == 1:
  print('Hello World')
else:
  a = int(input())
  b = int(input())
  print(a+b)
Buggy python submission (verdict: Runtime Error):
s = input()
t = []
for i in range(len(s)):
  if s[i] == '1':
    t.append('9')
  elif:
    t.append('1')
print(''.join(t))

Fixed submission:
s = input()
t = []
for i in range(len(s)):
  if s[i] == '1':
    t.append('9')
  else:
    t.append('1')
print(''.join(t))
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
t = input()

for i in range(len(s)):
  if s[i] == t[i]:
    continue
  else:
    tmp = s[i]
    s = s.replace(t[i],'X')
    s = s.replace(s[i],t[i])
    s = s.replace('X',tmp)
if s == t:
  print('Yes')
else:
  print('No')

Fixed submission:
s = input()
t = input()

slist,tlist = [[] for _ in range(26)],[[] for _ in range(26)]

for i in range(len(s)):
  slist[ord(s[i])-ord('a')].append(str(i))
  tlist[ord(t[i])-ord('a')].append(str(i))

stargets,ttargets = [],[]
for x in range(26):
  if len(slist[x]) > 0:
    stargets.append(''.join(slist[x]))
  if len(tlist[x]) > 0:
    ttargets.append(''.join(tlist[x]))
stargets.sort()
ttargets.sort()
if stargets == ttargets:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
n = int(input())
total = 0
for i in range(len(str(n))):
  total += str(n)[i]
if N%total == 0:
  print('Yes')
else:
  print('No')

Fixed submission:
n = int(input())
total = 0
for i in range(len(str(n))):
  total += int(str(n)[i])
if n%total == 0:
  print('Yes')
else:
  print('No')