Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n, i = map(int,input().sprit(" "))
ans = n - i + 1
print(ans)

Fixed submission:
n, i = map(int,input().split(" "))
ans = n - i + 1
print(ans)
Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split(" "))
if n%k=0:
    print("0")
else:
    print("1")


Fixed submission:
n, k = map(int, input().split(" "))
if n%k==0:
    print("0")
else:
    print("1")

Buggy python submission (verdict: Runtime Error):
n, k = map(int, input().split(" "))
if n%k=0:
    print("0")
else:
    print("1")


Fixed submission:
n, k = map(int, input().split(" "))
if n%k==0:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int, input().split(' ')))
i = 0
for i in range(n):
    ai = a[0:i] + a[i+1:n]
    aisrt = sorted(ai)
    l = int(len(aisrt)/2)
    print(aisrt[l])
    

Fixed submission:
a, b, x = map(lambda anm: int(anm),input().split(' '))
if a <= x <= a + b:
 print('YES')
else:
 print('NO')

Buggy python submission (verdict: Runtime Error):
n, m, x = map(int, input().split(' '))
ai = map(int, input().split(' '))
lcost = 0
rcost = 0
for gate in ai:
  if gate < x:
    lcost += 1
  else:
    rcost += 1

print(min(lcost, rcost))


Fixed submission:
a, b, x = map(lambda anm: int(anm),input().split(' '))
if a <= x <= a + b:
 print('YES')
else:
 print('NO')
Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split(' '))
ab = [i for i in range(a, b+1)]
if len(ab) <= 2*k:
  abp = [print(i) for i in ab]
else:
  del ab[k:-k]
  abp = [print(i) for i in ab]

Fixed submission:
a, b, k = map(int, input().split(' '))
if b - a + 1 < 2 * k:
  for i in range(a, b + 1):
    print(i) 
else:
  for i in range(a, a + k):
    print(i)
  for i in range(b - k + 1, b + 1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split(' '))
ab = [i for i in range(a, b+1)]
#print(ab)
for i in ab:
  if i in ab[k:-k]:
  	continue
  else:
    print(i)

Fixed submission:
a, b, k = map(int, input().split(' '))
if b - a + 1 < 2 * k:
  for i in range(a, b + 1):
    print(i) 
else:
  for i in range(a, a + k):
    print(i)
  for i in range(b - k + 1, b + 1):
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
a, b, k = map(int, input().split(' '))
ab = [i for i in range(a, b+1)]
del ab[k:-k]
abp = [print(i) for i in ab]


Fixed submission:
a, b, k = map(int, input().split(' '))
if b - a + 1 < 2 * k:
  for i in range(a, b + 1):
    print(i) 
else:
  for i in range(a, a + k):
    print(i)
  for i in range(b - k + 1, b + 1):
    print(i)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(str, input().split(' ')))
#print(s)

si = [print('Four')if 'Y' in s else print('Three') ]


Fixed submission:
n = int(input())
print(int(n/3))
Buggy python submission (verdict: Runtime Error):
alice = 0
bob = 0
n = int(input())
a = sorted(list(map(int, input().split(' ')))).reverse()

for i in a[::2]: alice += i
for i in a[1::2]: bob += i
print(alice - bob)

Fixed submission:
n = int(input())
a = int(input())
coins = 'No' if a < (n%500) else 'Yes'
print(coins)
Buggy python submission (verdict: Runtime Error):
alice = 0
bob = 0
n = int(input())
a = sorted(list(map(int, input().split(' ')))).reverse()

for i in a[::2]: alice += i
for i in a[1::2]: bob += i
print(alice - bob)

Fixed submission:
alice = 0
bob = 0
n = int(input())
a = list(map(int, input().split(' ')))
asrt = sorted(a, reverse = True)

for i in asrt[::2]: alice += i
for i in asrt[1::2]: bob += i
print(alice - bob)

Buggy python submission (verdict: Runtime Error):
alice = 0
bob = 0
n = int(input())
a = sorted(list(map(int, input().split(' ')))).reverse()

for i in asorted[::2]: alice += i
for i in asorted[1::2]: bob += i
print(alice - bob)

Fixed submission:
alice = 0
bob = 0
n = int(input())
a = list(map(int, input().split(' ')))
asrt = sorted(a, reverse = True)

for i in asrt[::2]: alice += i
for i in asrt[1::2]: bob += i
print(alice - bob)
Buggy python submission (verdict: Runtime Error):
ab = int(input().replace(' ', ''))
if type(sqrt(ab)) is int:
  print('Yes')
else:
  print('No')

Fixed submission:
ab = int(input().replace(' ', ''))
import math
sq = math.sqrt(ab)
if sq - int(sq) == 0:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split(' '))
l = a + b
r = c + d

if l > r:
  print('Left')
elsif l = r:
  print('Balanced')
else:
  print('Right')

Fixed submission:
a, b, c, d = map(int, input().split(' '))
l = a + b
r = c + d

if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split(' '))
r = a + b
l = c + d

if l > r:
  print('Left')
elsif l = r:
  print('Balanced')
else:
  print('Right')


Fixed submission:
a, b, c, d = map(int, input().split(' '))
l = a + b
r = c + d

if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')

Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split(' '))
r = a + b
l = c + d

if l > r:
  print('left')
elsif l = r:
  print('Balanced')
else:
  print('Right')

Fixed submission:
a, b, c, d = map(int, input().split(' '))
l = a + b
r = c + d

if l > r:
  print('Left')
elif l == r:
  print('Balanced')
else:
  print('Right')
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split(' '))
print(floor((a + b)/2))

Fixed submission:
a, b = map(int, input().split(' '))
import math
print(math.ceil((a + b)/2))
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," ",end="")
print()

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

ans = [0]*n
for i,num in enumerate(a):
    #print(a.index(i+1)+1," ",end="")
    ans[num-1] = i+1
for i in ans:
    print(i," ",end="")

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," ",end="")
print()

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

ans = [0]*n
for i,num in enumerate(a):
    #print(a.index(i+1)+1," ",end="")
    ans[num-1] = i+1
for i in ans:
    print(i," ",end="")
Buggy python submission (verdict: Runtime Error):
from math import gcd
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
    
    
a, b = map(int,input().split())
a_d = make_divisors(a)
b_d = make_divisors(b)

yakusu = []

for i in a_d:
    if i in b_d:
        yakusu.append(i)

ans = [yakusu.pop(0)]
for i in yakusu:
    flg=0
    tmp = 0
    for j,num in enumerate(ans):
        if gcd(num,i) != 1:
            ans[j] = min(i,num)
            flg = 1
            break
    if flg == 0:
        ans.append(i)

print(len(ans))



Fixed submission:
from fractions import gcd
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
    
    
a, b = map(int,input().split())
a_d = make_divisors(a)
b_d = make_divisors(b)

yakusu = []

for i in a_d:
    if i in b_d:
        yakusu.append(i)

ans = [yakusu.pop(0)]
for i in yakusu:
    flg=0
    tmp = 0
    for j,num in enumerate(ans):
        if gcd(num,i) != 1:
            ans[j] = min(i,num)
            flg = 1
            break
    if flg == 0:
        ans.append(i)

print(len(ans))

Buggy python submission (verdict: Runtime Error):
from math import gcd
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
    
    
a, b = map(int,input().split())
a_d = make_divisors(a)
b_d = make_divisors(b)

yakusu = []

for i in a_d:
    if i in b_d:
        yakusu.append(i)

ans = [yakusu.pop(0)]
for i in yakusu:
    flg=0
    tmp = 0
    for j,num in enumerate(ans):
        if gcd(num,i) != 1:
            ans[j] = min(i,num)
            flg = 1
            break
    if flg == 0:
        ans.append(i)

print(len(ans))



Fixed submission:
from fractions import gcd
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
    
    
a, b = map(int,input().split())
a_d = make_divisors(a)
b_d = make_divisors(b)

yakusu = []

for i in a_d:
    if i in b_d:
        yakusu.append(i)

ans = [yakusu.pop(0)]
for i in yakusu:
    flg=0
    tmp = 0
    for j,num in enumerate(ans):
        if gcd(num,i) != 1:
            ans[j] = min(i,num)
            flg = 1
            break
    if flg == 0:
        ans.append(i)

print(len(ans))
Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
weight = [0 for i in range(n)]
value = [0 for i in range(n)]
for i in range(n):
    weight[i],value[i] = map(int,input().split())
    

#dp[i][j]: i番目の品物までの中から選び、重さがj以下になる時の、価値の総和の最大値
dp = [[0 for i in range(w+1)] for j in range(n+1)]
dp[1][weight[0]] = value[0]

for i in range(1,n):
    for j in range(w+1):
        if j - weight[i] >= 0:
            dp[i+1][j] = max(dp[i][j-weight[i]]+value[i],dp[i][j])
        else:
            dp[i+1][j] = dp[i][j]
            
print(dp[n][w])

Fixed submission:
n,w = map(int,input().split())
weight = [0 for i in range(n)]
value = [0 for i in range(n)]
for i in range(n):
    weight[i],value[i] = map(int,input().split())
    

#dp[i][j]: i番目の品物までの中から選び、重さがj以下になる時の、価値の総和の最大値
dp = [[None for i in range(w+1)] for j in range(n+1)]
dp[1][weight[0]] = value[0]

for i in range(1,n):
    for j in range(w+1):
        if j - weight[i] >= 0:
            if dp[i][j-weight[i]] != None and dp[i][j] != None:
                dp[i+1][j] = max(dp[i][j-weight[i]]+value[i],dp[i][j])
            elif dp[i][j-weight[i]] == None and dp[i][j] != None:
                dp[i+1][j] = dp[i][j]
            elif dp[i][j-weight[i]] != None and dp[i][j] == None:
                dp[i+1][j] = dp[i][j-weight[i]]+value[i]
            else:
                dp[i+1][weight[i]] = value[i]
        else:
            dp[i+1][j] = dp[i][j]
            
print(max(i for i in dp[n] if i is not None))

Buggy python submission (verdict: Time Limit Exceeded):
n,w = map(int,input().split())
weight = []
value = []
for i in range(n):
    tmp1,tmp2 = map(int,input().split())
    weight.append(tmp1)
    value.append(tmp2)

#dp[i][j]: i番目の品物までの中から選び、重さがj以下になる時の、価値の総和の最大値
dp = [[0 for i in range(w+1)] for j in range(n+1)]
dp[1][weight[0]] = value[0]

for i in range(1,n):
    for j in range(w+1):
        if j - weight[i] >= 0:
            dp[i+1][j] = max(dp[i][j-weight[i]]+value[i],dp[i][j])
        else:
            dp[i+1][j] = dp[i][j]
            
print(dp[n][w])

Fixed submission:
n,w = map(int,input().split())
weight = [0 for i in range(n)]
value = [0 for i in range(n)]
for i in range(n):
    weight[i],value[i] = map(int,input().split())
    

#dp[i][j]: i番目の品物までの中から選び、重さがj以下になる時の、価値の総和の最大値
dp = [[None for i in range(w+1)] for j in range(n+1)]
dp[1][weight[0]] = value[0]

for i in range(1,n):
    for j in range(w+1):
        if j - weight[i] >= 0:
            if dp[i][j-weight[i]] != None and dp[i][j] != None:
                dp[i+1][j] = max(dp[i][j-weight[i]]+value[i],dp[i][j])
            elif dp[i][j-weight[i]] == None and dp[i][j] != None:
                dp[i+1][j] = dp[i][j]
            elif dp[i][j-weight[i]] != None and dp[i][j] == None:
                dp[i+1][j] = dp[i][j-weight[i]]+value[i]
            else:
                dp[i+1][weight[i]] = value[i]
        else:
            dp[i+1][j] = dp[i][j]
            
print(max(i for i in dp[n] if i is not None))
Buggy python submission (verdict: Runtime Error):
import gcd from fractions

def lcm(a, b):
    return a * b // gcd(a, b)

def f(x, a, b):
    return x - x // a - x // b + x // lcm(a, b)

def main():
    a, b, c, d = map(int, input().split())
    print(f(b, c, d) - f(a - 1, c, d))

if __name__ == '__main__':
    main()

Fixed submission:
import fractions


def lcm(a, b):
    return a * b // fractions.gcd(a, b)


def f(x, a, b):
    return x - x // a - x // b + x // lcm(a, b)


def main():
    a, b, c, d = map(int, input().split())
    print(f(b, c, d) - f(a - 1, c, d))


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n,q=map(int,input().split())
s=input()

for _ in range(q):
    l,r=map(int, input().split())
    ps=s[l - 1:r]
    cnt=0
    for i in range(0,len(ps)-1):
        if ps[i: i+2] == 'AC':
            cnt+=1
    print(cnt)

Fixed submission:
import sys
input = sys.stdin.readline
n,q=map(int,input().split())
s=input()
cnt = 0
list=[0]
for i in range(0,len(s)-1):
    if s[i: i + 2] == 'AC':
        cnt += 1
    list.append(cnt)

for _ in range(q):
    l,r=map(int, input().split())
    print(list[r-1]-list[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
n,q=map(int,input().split())
s=input()

for _ in range(q):
    l,r=map(int, input().split())
    print(s[l-1:r].count('AC'))

Fixed submission:
import sys
input = sys.stdin.readline
n,q=map(int,input().split())
s=input()
cnt = 0
list=[0]
for i in range(0,len(s)-1):
    if s[i: i + 2] == 'AC':
        cnt += 1
    list.append(cnt)

for _ in range(q):
    l,r=map(int, input().split())
    print(list[r-1]-list[l-1])

Buggy python submission (verdict: Time Limit Exceeded):
n,q=map(int,input().split())
s=input()

for _ in range(q):
    l,r=map(int, input().split())
    print(s[l-1:r].count('AC'))

Fixed submission:
import sys
input = sys.stdin.readline
n,q=map(int,input().split())
s=input()
cnt = 0
list=[0]
for i in range(0,len(s)-1):
    if s[i: i + 2] == 'AC':
        cnt += 1
    list.append(cnt)

for _ in range(q):
    l,r=map(int, input().split())
    print(list[r-1]-list[l-1])
Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for _ in range(n):
    a = list(map(int, input().split()))
    if a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + c > 0:
        ans += 1
print(ans)


Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for ai in a:
    absum = 0
    for i in range(m):
        absum += ai[i] * b[i]
    if absum + c > 0:
        ans += 1
print(ans)

Buggy python submission (verdict: Runtime Error):
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
ans = 0
for _ in range(n):
    a = list(map(int, input().split()))

    if a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + c > 0:
         ans += 1
print(ans)


Fixed submission:
n, m, c = map(int, input().split())
b = list(map(int, input().split()))
a = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for ai in a:
    absum = 0
    for i in range(m):
        absum += ai[i] * b[i]
    if absum + c > 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r):
    if a%i==0 & b%i==0:
        tar.append(i)
print(tar[-k])

Fixed submission:
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r+1):
    if a%i==0 and b%i==0:
        tar.append(i)
print(tar[-k])

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)-1
for i in range(2,r):
    if a%i==0 & b%i==0:
        tar.append(i)
print(tar[-k])

Fixed submission:
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r+1):
    if a%i==0 and b%i==0:
        tar.append(i)
print(tar[-k])

Buggy python submission (verdict: Runtime Error):
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)-1
for i in range(2,r):
    if a%i==0 & b%i==0:
        tar.append(i)
tar.sort(reverse=True)
print(tar[k-1])

Fixed submission:
a,b,k=map(int,input().split())
tar=[1]
r=min(a,b)
for i in range(2,r+1):
    if a%i==0 and b%i==0:
        tar.append(i)
print(tar[-k])
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h=[int(input()) for i in range(n)]
h=sorted(h)
mi=float('inf')
 
for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

Fixed submission:
x = int(input())
if x == 25:
    print('Christmas')
elif x==24:
    print('Christmas Eve')
elif x==23:
    print('Christmas Eve Eve')
elif x==22:
    print('Christmas Eve Eve Eve')
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h=[int(input()) for i in range(n)]
h=sort(h)
mi=float('inf')
 
for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

Fixed submission:
n,k = map(int,input().split())
h=list(int(input()) for i in range(n))
h.sort()
mi=float('inf')

for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h=sorted(list(int(input()) for i in range(n)))
h+=h
mi=float('inf')
ansma=0
ansmi=0
for i in range(n-2):
    tmp=h[i:i+k]
    tmpma=max(tmp)
    tmpmi=min(tmp)
    if i == n:
        break
    if mi > tmpma - tmpmi:
        mi=tmpma-tmpmi
        ansma=tmpma
        ansmi=tmpmi
 
print(ansma-ansmi)

Fixed submission:
n,k = map(int,input().split())
h=list(int(input()) for i in range(n))
h.sort()
mi=float('inf')

for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h=sorted(list(int(input()) for i in range(n)))
h+=h
mi=float('inf')
ansma=0
ansmi=0
for i in range(int(len(h)/2)):
    tmp=h[i:i+k]
    tmpma=max(tmp)
    tmpmi=min(tmp)
    if mi > tmpma - tmpmi:
        mi=tmpma-tmpmi
        ansma=tmpma
        ansmi=tmpmi

print(ansma-ansmi)

Fixed submission:
n,k = map(int,input().split())
h=list(int(input()) for i in range(n))
h.sort()
mi=float('inf')

for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h=sorted(list(int(input()) for i in range(n)))
h+=h
mi=float('inf')
a=0
for i in range(int(len(h)/2)):
    tmp=h[i:i+k]
    if mi > max(tmp)-min(tmp):
        mi=max(tmp)-min(tmp)
        a=i

print(max(h[a:a+k])-min(h[a:a+k]))

Fixed submission:
n,k = map(int,input().split())
h=list(int(input()) for i in range(n))
h.sort()
mi=float('inf')

for i in range(n-k+1):
    mi = min(mi, h[i+k-1]-h[i])
 
print(mi)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())
 
if n == 1:
    print("Hello World")
    exit()
else:
    print(a + b)
    exit()

Fixed submission:
n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)  
exit()

Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
b = int(input())

if n == 1:
    print("Hello World")
else:
    print(a + b)

Fixed submission:
n = int(input())
if n == 1:
    print("Hello World")
else:
    a = int(input())
    b = int(input())
    print(a + b)  
exit()
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input().split())

s = ['-' * (w + 2)]
for i in range(h):
    s.append('-' + input() + '-')
s.append('-' * (w + 2))

for hi in range(1,h+1):
    ans=''
    for wi in range(1,h+1):
        if s[hi][wi] == '#':
            ans += '#'
        else:
            c = [s[hi-1][wi-1],s[hi][wi-1],s[hi+1][wi-1],s[hi-1][wi],s[hi+1][wi],s[hi-1][wi+1],s[hi][wi+1],s[hi+1][wi+1]]
            ans += str(c.count('#'))
    print(ans)

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

s = ['-'*(w+2)]
for i in range(h):
    s += ['-'+input()+'-']
s += ['-'*(w+2)]

for hi in range(1,h+1):
    ans = ''
    for wi in range(1,w+1):
        if s[hi][wi] == '#':
            ans += '#'
        else:
            c = [s[hi-1][wi-1],s[hi][wi-1],s[hi+1][wi-1],s[hi-1][wi],s[hi+1][wi],s[hi-1][wi+1],s[hi][wi+1],s[hi+1][wi+1]]
            ans += str(c.count('#'))
    print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
paper=list()
for _ in range(n):
    a = input()
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

Fixed submission:
n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))

Buggy python submission (verdict: Runtime Error):
n=int(input())
paper=[]
for _ in range(n):
    a = input()
    if a in paper:
        paper.remove(a)
    else:
        paper.add(a)
print(len(paper))

Fixed submission:
n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
paper=[]
for _ in range(n):
    a = int(input())
    if a in paper:
        paper.remove(a)
    else:
        paper.append(a)
print(len(paper))

Fixed submission:
n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
al=[int(input()) for _ in range(n)]

setal=set(al)
ans=0
for seta in setal:
    if al.count(seta)%2 == 1:
        ans+=1

print(ans)

Fixed submission:
n=int(input())
s=set()
for _ in range(n):
    a = input()
    if a in s:
        s.remove(a)
    else:
        s.add(a)
print(len(s))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

n=int(input())
tl=[int(input()) for _ in range(n)]

def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
    
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


print(lcm(*tl))

Fixed submission:
def gcd(a, b):
    while b != 0:
        a, b = b, a%b
    return a
 
N = int(input())
A = [int(input()) for i in range(N)]
 
ans = A[0]
 
for i in A:
    ans = (ans*i)//gcd(ans, i)
print(ans)
Buggy python submission (verdict: Runtime Error):
n, l = map(int, input().sprit())
s = [input() for _ in range(n)]
s.sort()
print("".join(s))

Fixed submission:
n, l = map(int, input().split())
s = [input() for _ in range(n)]
s.sort()
print("".join(s))
Buggy python submission (verdict: Runtime Error):
x,y = input().split()
x = int(x)
y = int(y)
if x < y:
  a = y
  b = x
else:
  a = x
  b = y
 
while b:
  a, b = b, a % b
 
print(int(x*y/a))

Fixed submission:
a = input()
b = input()
 
answer_list = ["1","2","3"]
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])

Buggy python submission (verdict: Runtime Error):
x,y = input().split()
x = int(x)
y = int(y)
if x < y:
  a = y
  b = x
else:
  a = x
  b = y
 
while b:
  a, b = b, a % b
 
print(x*y//a)

Fixed submission:
a = input()
b = input()
 
answer_list = ["1","2","3"]
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])

Buggy python submission (verdict: Runtime Error):
N = input()
S,T = input().split()
 
a = ""
for i in range(N):
  a+=S[i]+T[i]
print(a)

Fixed submission:
a = input()
b = input()
 
answer_list = ["1","2","3"]
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()
 
answer_list = {"1","2","3"}
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])

Fixed submission:
a = input()
b = input()
 
answer_list = ["1","2","3"]
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

answer_list = {"1","2","3"}
answer_list -= a
answer_list -= b

print(answer_list[0])

Fixed submission:
a = input()
b = input()
 
answer_list = ["1","2","3"]
answer_list.remove(a)
answer_list.remove(b)
 
print(answer_list[0])