Harryxun/GPT-100-sft-dataset huggingface dataset:
Problem p02759 (python)

Fixed submission:
n = int(input())
if n%2 == 0:
	print(n//2)
else:
    print(n//2+1)

Buggy submission (verdict: Runtime Error):
n = int(intput())
if n % 2 == 0:
  print(n // 2)
else:
  print(n // 2 + 1)
Problem p02777 (python)

Fixed submission:
s, t = map(str, input().split())
a, b = map(int, input().split())
u = input()
if s == u:
  print(a - 1, b)
else:
  print(a, b - 1)

Buggy submission (verdict: Runtime Error):
s, t = map(input().split())
a, b = map(int, input().split())
u = input()
if s == u:
  print(a - 1, b)
else:
  print(a, b - 1)

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

if s, t == u:
  print(a + b - 1)
else:
  print(a + b)
Problem p02835 (python)

Fixed submission:
a = map(int, input().split())
if sum(a) <= 21:
    print('win')
else:
    print('bust')

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
n = sum(a)
if a <= 21:
  print('win')
else:
  print('burst')

Buggy submission (verdict: Runtime Error):
a = map(int, input().split())
n = sum(a)
if a < 22:
  print('win')
else:
  print('burst')
Problem p02831 (python)

Fixed submission:
import fractions
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

a,b = MAP()

print(a*b//fractions.gcd(a,b))

Buggy submission (verdict: Runtime Error):
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

a,b = MAP()

print(a*b//math.gcd(a,b))
Problem p02897 (python)

Fixed submission:
import math
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
if n%2==0:
    print(0.5)
else:
    print(math.ceil(n/2)/n)

Buggy submission (verdict: Runtime Error):
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n = INT()
if n%2==0:
    print(n/2)
else:
    print(math.ceil(n/2)/n)
Problem p02933 (python)

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

if a>=3200:
    print(s)
else:
    print("red")

Buggy submission (verdict: Runtime Error):
def dfs(v,p):
    for i in tree[v]:
        if i==p:
            continue
        res[i]+=res[v]
        dfs(i,v)

n,q = map(int, input().split())
tree = [[] for _ in range(n)]
for i in range(n-1):
    a,b = map(int,input().split())
    tree[a-1].append(b-1)
    tree[b-1].append(a-1)

res = [0]*n
for i in range(q):
    p,x = map(int,input().split())
    res[p-1] += x

dfs(0,-1)
print(*res)
Problem p02990 (python)

Fixed submission:
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**7)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

def cmb(n, r):
    return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))

n,k = MAP()

for i in range(1,k+1):
    try:
        print(cmb(n-k+1,i)*cmb(k-1,i-1)%MOD)
    except:
        print(0)

Buggy submission (verdict: Runtime Error):
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush,heapify
sys.setrecursionlimit(10**7)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

def cmb(n, r):
    return math.factorial(n)//(math.factorial(r)*math.factorial(n-r))

n,k = MAP()

for i in range(1,k+1):
    print(cmb(n-k+1,i)*cmb(k-1,i-1)%MOD)
Problem p03013 (python)

Fixed submission:
import math
import collections
import itertools
import sys
import bisect
from heapq import heappop,heappush
sys.setrecursionlimit(10**6)
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

n,m = MAP()
a = [INT() for _ in range(m)]

# 高速版
def fib(n):
    if n <= 1:
        return n
    result = [1, 0, 0, 1]
    matrix = [1, 1, 1, 0]
    while n > 0:
        if n % 2:
            result = mul(matrix, result)
        matrix = mul(matrix, matrix)
        n //= 2
    return result[2]

def mul(a, b):
    return [a[0]*b[0] + a[1]*b[2],
            a[0]*b[1] + a[1]*b[3],
            a[2]*b[0] + a[3]*b[2],
            a[2]*b[1] + a[3]*b[3]]

start = 0
ans = 1

for k in a:
    tmp = k-start
    if tmp==0:
        print(0)
        exit(0)
    ans *= fib(tmp)
    ans%=MOD
    start = k+1

ans*=fib(n-start+1)
ans%=MOD

print(ans)

Buggy submission (verdict: Runtime Error):
mod = 10**9+7
n,m = map(int,input().split())
a = [int(input()) for _ in range(m)]

def fib(n):
    if (n==1) or (n==2):
        return 1
    else:
        return fib(n-1)+fib(n-2)

start = 0
ans = 1

for k in a:
    tmp = k-start
    if tmp==0:
        print(0)
        exit(0)
    ans *= fib(tmp)
    ans%=mod
    start = k+1

ans*=fib(n-start+1)
ans%=mod

print(ans)
Problem p03104 (python)

Fixed submission:
def MAP(): return list(map(int,input().split()))
def f(x):
    tmp = (x+1)%4
    if tmp==0:
        return 0
    elif tmp==1:
        return x
    elif tmp==2:
        return 1
    else:
        return 1^x
A,B = MAP()
print(f(A-1)^f(B))

Buggy submission (verdict: Runtime Error):
def MAP(): return list(map(int,input().split()))

#排他的論理和
def XOR(lst):
    #lst = [000,010,011...] type is str
    lst = sorted(lst,key = lambda x:len(x),reverse = True)
    n = len(lst[0])
    ans = []
    for i in range(1,n+1):
        tmp = 0
        for j in lst:
            if len(j)>=i:
                if j[-i]=="1":
                    tmp+=1
        if tmp%2==0:
            ans.insert(0,"0")
        else:
            ans.insert(0,"1")
    return "".join(ans)

#10進数→2進数
def binary(num):
    lst = []
    while num!=0:
        lst.insert(0,num%2)
        num = num//2
    return "".join(map(str,lst))

#2進数→10進数
def decimal(num):
    ans=0
    for i,x in enumerate(str(num)[::-1]):
        ans += int(x)*2**i
    return ans

A,B = MAP()
if A%2==0:
    lst = [1]*((B-A+1)//2)
else:
    lst = [A] + [1]*((B-A)//2)
if B%2==0:
    lst += [B]
print(decimal(XOR([binary(i) for i in lst])))
Problem p03127 (python)

Fixed submission:
def MAP(): return list(map(int,input().split()))
import fractions

n = int(input())
A = MAP()

tmp=A[0]
for i in range(1,n):
    tmp = fractions.gcd(tmp,A[i])
print(tmp)

Buggy submission (verdict: Runtime Error):
def MAP(): return list(map(int,input().split()))
import math

n = int(input())
A = MAP()

tmp=A[0]
for i in range(1,n):
    tmp = math.gcd(tmp,A[i])
print(tmp)
Problem p02629 (python)

Fixed submission:
N = int(input())
alpha = ['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']

def find_name(tmp_N, p, keta, alpha):
  if keta == 1:
    for i in range(len(alpha)):
      #print(tmp_N + (i+1))
      if tmp_N + (i+1) == N:
        p.append(i)
        return p
  else:
    for i in range(len(alpha)):
      if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):
        p.append(i)
        tmp_N = tmp_N + 26**(keta-1)*i
        keta -= 1
        return find_name(tmp_N, p, keta, alpha)
    
# 桁数の確認
keta = 1
tmp_N = 0
while 1:
  if tmp_N + 1 <= N <= tmp_N + 26**keta:
    break
  else:
    keta += 1
    tmp_N += 26**(keta-1)
#print(keta)

p = []
p = find_name(tmp_N, p, keta, alpha)
out = ''
#print(p)
for i in range(len(p)):
  out += alpha[p[i]]
print(out)

Buggy submission (verdict: Runtime Error):
N = int(input())
alpha = ['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']

def find_name(tmp_N, p, keta, alpha):
  if keta == 1:
    for i in range(len(alpha)):
      #print(tmp_N + (i+1))
      if tmp_N + (i+1) == N:
        p.append(i)
        return p
  else:
    for i in range(len(alpha)):
      #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))
      if tmp_N + 26**(keta-1)*i+1 <= N <= tmp_N + 26**(keta-1)*(i+1):
        #print(tmp_N + 26**(keta-1)*i+1, tmp_N + 26**(keta-1)*(i+1))
        p.append(i)
        tmp_N = tmp_N + 26**(keta-1)*i
        keta -= 1
        return find_name(tmp_N, p, keta, alpha)
    
# 桁数の確認
keta = 1
while 1:
  tmp_N = 26**(keta-1)
  if tmp_N + 26**(keta-1)+1 <= N <= tmp_N + 26**keta:
    break
  else:
    keta += 1
#print(keta)

tmp_N = 0
if keta == 1:
  tmp_N = 0
else:
  tmp_N = 26**(keta-1)
#print(tmp_N)
p = []
p = find_name(tmp_N, p, keta, alpha)
out = ''
#print(p)
for i in range(len(p)):
  out += alpha[p[i]]
print(out)
Problem p03038 (python)

Fixed submission:
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = []
for i in range(M):
  tmp = list(map(int, input().split()))
  BC.append(tmp)

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

j = 0
for i in range(M):
  count = 0
  while A[j] < BC[i][1]:
    A[j] = BC[i][1]			# 値を置き換える
    j += 1
    count += 1
    if count == BC[i][0] or j == N:
      break
  if j == N:
    break
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = []
for i in range(M):
  tmp = list(map(int, input().split()))
  BC.append(tmp)

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

j = 0
for i in range(M):
  count = 0
  while A[j] < BC[i][1]:
    A[j] = BC[i][1]			# 値を置き換える
    j += 1
    count += 1
    if count == BC[i][0] or j == N:
      break
print(sum(A))

Buggy submission (verdict: Runtime Error):
N, M = map(int, input().split())
A = list(map(int, input().split()))
BC = []
for i in range(M):
  tmp = list(map(int, input().split()))
  BC.append(tmp)

A.sort()
BC.sort(key=lambda x: x[1], reverse=True)

j = 0
for i in range(M):
  count = 0
  while A[j] < BC[i][1]:
    A[j] = BC[i][1]			# 値を置き換える
    j += 1
    count += 1
    if count == BC[i][0]:
      break
print(sum(A))
Problem p02771 (python)

Fixed submission:
A, B, C = map(int, input().split())

if (A==B and B!=C) or (A==C and C!=B) or (C==B and B!=A):
  print('Yes')
else:
  print('No')

Buggy submission (verdict: Runtime Error):
A, B, C = map(int, input().split())

if (A==B&&B!=C) || (A==C&&C!=B) || (C==B&&B!=A):
  print('Yes')
else:
  print('No')
Problem p03803 (python)

Fixed submission:
A,B = map(int, input().split())
if A==B:
  print("Draw")
elif A == 1 or (B != 1 and A>B):
  print("Alice")
else:
  print("Bob")

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A==B:
  print("draw")
elif A == 1 or (b != 1 and A>B):
  print("Alice")
else:
  print("Bob")

Buggy submission (verdict: Runtime Error):
A,B = map(int, input().split())
if A==B:
  print("draw")
elif A == 1 or (b != 1 and A>B):
  print("Alice")
else:
  print("Bob");
Problem p02552 (python)

Fixed submission:
n=int(input())
if n==1:
  print(0)
else:
  print(1)

Buggy submission (verdict: Runtime Error):
n=int(input().split())
if n==1:
  print(0)
else:
  print(1)
Problem p02627 (python)

Fixed submission:
a=input()
if a==a.upper():
  print("A")
else:
  print("a")

Buggy submission (verdict: Runtime Error):
a=input()
if a==a.upeer():
  print("A")
else:
  print("a")
Problem p02578 (python)

Fixed submission:
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_c
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

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

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
    tc = get_int()
    arr = get_array()
    ans = 0
    Max = arr[0]
    for i in arr[1:]:
    	Max = max(Max,i)
    	ans += Max-i
    stdout.write(str(ans)+'\n')
if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_c
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

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

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
    tc = get_int()
    # while(tc):
	arr = get_array()
	ans = 0
	Max = arr[0]
	for i in arr[1:]:
		Max = max(Max,i)
		ans += Max-i
	stdout.write(str(ans)+'\n')
    	# tc-=1

if __name__ == "__main__":
    main()

Buggy submission (verdict: Runtime Error):
'''
Problem Link - https://atcoder.jp/contests/abc176/tasks/abc176_c
'''
from sys import stdin,stdout
from math import *
from collections import *

mod = 1000000007

def gcd(a,b):
	while b:
		a,b = b,a%b
	return a

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

def set_bits(X):
	c = 0
	while X:
		X &= (X-1);c += 1
	return c

def compute_MOD(N,M): return (N%M + M) % M

def get_array(): return list(map(int, stdin.readline().split()))
 
def get_ints(): return map(int, stdin.readline().split())

def get_int(): return int(stdin.readline())

def get_input(): return stdin.readline().strip()

def main():
    tc = get_int()
    while(tc):
    	arr = get_array()
    	ans = 0
    	Max = arr[0]
    	for i in arr[1:]:
    		Max = max(Max,i)
    		ans += Max-i
    	stdout.write(str(ans)+'\n')
    	tc-=1

if __name__ == "__main__":
    main()
Problem p02725 (python)

Fixed submission:
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, arrayNM[1]):
  distance += route[i]

print(distance)

Buggy submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, array[1]):
  distance += route[i]

print(distance)

Buggy submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex + 1, array[1]):
  distance += route[i]

print(distance)
print(route)

Buggy submission (verdict: Runtime Error):
arrayNM = list(map(int, input().split()))
array = list(map(int, input().split()))
route = [array[0] + arrayNM[0] - array[arrayNM[1] - 1]]
for i in range(1,arrayNM[1]):
  route.append(array[i] - array[i-1])
  
Max = max(route)
maxIndex = route.index(Max)
distance = 0

for i in range(0,maxIndex):
  distance += route[i]

for i in range(maxIndex, array[0]):
  distance += route[i]

print(distance)
print(route)
Problem p02729 (python)

Fixed submission:
integer = list(map(int, input().split())) 
conbi = (integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 ) ) / 2
print(int(conbi))

Buggy submission (verdict: Runtime Error):
integer = int(input().split())
conbi = (integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 )) / 2
print(conbi)

Buggy submission (verdict: Runtime Error):
integer = int(input().split())
conbi = ((integer[0] * (integer[0] - 1) + integer[1] * (integer[1] -1 )) / 2
print(conbi)
Problem p02552 (python)

Fixed submission:
print(int(input()) ^ 1)

Buggy submission (verdict: Runtime Error):
princt(int(input()) ^ 1)
Problem p02557 (python)

Fixed submission:
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')
import numpy as np

def main():
	n=II()
	A=np.array([0]+LI()+[10**6])
	B=np.array([0]+LI()+[10**6])
	Ar=(A[:-1]<A[1:])[1:]
	Al=(A[:-1]<A[1:])[:-1]
	Br=(B[:-1]<B[1:])[1:]
	Bl=(B[:-1]<B[1:])[:-1]
	
	A=A[1:-1]
	B=B[1:-1]
	
	#print(Al,Ar,Bl,Br)
	
	AAl=np.array([10**7]*(n+1))
	AAr=np.array([10**7]*(n+1))
	BBl=np.array([-10**7]*(n+1))
	BBr=np.array([-10**7]*(n+1))
	
	for i in range(n):
		if Al[i]==1:
			AAl[A[i]]=i
		if Ar[i]==1:
			AAr[A[i]]=i
		if Bl[i]==1:
			BBl[B[i]]=i
		if Br[i]==1:
			BBr[B[i]]=i
	
	L=AAl-BBr
	R=AAr-BBl
	R=R[R<10**6]
	#print(L)
	LL=L.min()
	
	try:
		RR=max(R)
	except:
		RR=0
	#print(LL)
	#print(RR)
	
	if RR-LL+2>n:
		print("No")
	else:
		print("Yes")
		C=np.concatenate([B[-LL+1:],B[:-LL+1]])
		print(*C)
	
	


	









if __name__=="__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys

input=sys.stdin.buffer.readline


#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return sys.stdin.read()


def II(): return int(input())


def MI(): return map(int,input().split())


def MF(): return map(float,input().split())


def LI(): return list(map(int,input().split()))


def LF(): return list(map(float,input().split()))


def TI(): return tuple(map(int,input().split()))


# rstrip().decode('utf-8')
import numpy as np

def main():
	n=II()
	A=np.array([0]+LI()+[10**6])
	B=np.array([0]+LI()+[10**6])
	Ar=(A[:-1]<A[1:])[1:]
	Al=(A[:-1]<A[1:])[:-1]
	Br=(B[:-1]<B[1:])[1:]
	Bl=(B[:-1]<B[1:])[:-1]
	
	A=A[1:-1]
	B=B[1:-1]
	
	#print(Ar*A)
	
	AAl=np.array([10**7]*(n+1))
	AAr=np.array([10**7]*(n+1))
	BBl=np.array([-10**7]*(n+1))
	BBr=np.array([-10**7]*(n+1))
	
	for i in range(n):
		if Al[i]==1:
			AAl[A[i]]=i
		if Ar[i]==1:
			AAr[A[i]]=i
		if Bl[i]==1:
			BBl[B[i]]=i
		if Br[i]==1:
			BBr[B[i]]=i
	
	L=AAl-BBr
	R=AAr-BBl
	R=R[R<10**6]
	#print(L)
	LL=L.min()
	RR=max(R)
	#print(LL)
	#print(RR)
	
	if RR-LL+2>n:
		print("No")
	else:
		print("Yes")
		C=np.concatenate([B[RR+1:],B[:RR+1]])
		print(*C)
	
	


	









if __name__=="__main__":
	main()
Problem p02580 (python)

Fixed submission:
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

from collections import deque

def main():
	h,w,m=MI()
	A=[0]*(h+1)
	B=[0]*(w+1)
	C=[[] for _ in range(h+1)]

	for _ in range(m):
		hh,ww=MI()
		A[hh]+=1
		B[ww]+=1
		C[hh].append(ww)


	for i in range(h+1):
		C[i].sort()

	AA=max(A)
	BB=max(B)

	x=[]
	y=[]

	for i,v in enumerate(A):
		if v==AA:
			x.append(i)

	for i,v in enumerate(B):
		if v==BB:
			y.append(i)

	#print(x,y,AA,BB)
	#print(C)
	ans=0

	for i in x:
		C[i].append(10**7)
		#print("a")
		#print(C[i])
		#print(y)
		a=0
		for j in y:
			while a<len(C[i]):
				if j==C[i][a]:
					a+=1
					break
				elif j<C[i][a]:
					print(AA+BB)
					exit()
				else:
					a+=1

	print(AA+BB-1)
















if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
import sys
input = sys.stdin.buffer.readline

#sys.setrecursionlimit(10**9)
#from functools import lru_cache

def RD(): return input().rstrip().decode()
def II(): return int(input())
def FI(): return int(input())
def MI(): return map(int,input().split())
def MF(): return map(float,input().split())
def LI(): return list(map(int,input().split()))
def LF(): return list(map(float,input().split()))
def TI(): return tuple(map(int,input().split()))
# rstrip().decode()

from collections import deque

def main():
	h,w,m=MI()
	A=[0]*(h+1)
	B=[0]*(w+1)
	C=[[] for _ in range(h+1)]

	for _ in range(m):
		hh,ww=MI()
		A[hh]+=1
		B[ww]+=1
		C[hh].append(ww)


	for i in range(h+1):
		C[i].sort()

	AA=max(A)
	BB=max(B)

	x=[]
	y=[]

	for i,v in enumerate(A):
		if v==AA:
			x.append(i)

	for i,v in enumerate(B):
		if v==BB:
			y.append(i)

	#print(x,y,AA,BB)
	ans=0

	for i in x:
		#print("a")
		#print(C[i])
		#print(y)
		a=0
		for j in y:
			while True:
				if j==C[i][a]:
					a+=1
					break
				elif j<C[i][a]:
					print(AA+BB)
					exit()
				else:
					break

	print(AA+BB-1)
















if __name__ == "__main__":
	main()
Problem p02793 (python)

Fixed submission:
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

#from math import gcd
from fractions import gcd

def main():
	n=int(input())
	A=list(map(int,input().split()))
	B=set(A)
	A=list(A)
	A.sort(reverse=True)
	a=1
	ans=0
	for i in A:
		g=gcd(a, i)
		ans *=i//g
		a=a*i//gcd(a, i)
		ans+=a//i
	
	
	
	
	print(ans%mod)
	
	
	
	
	
	


if __name__ == "__main__":
	main()

Buggy submission (verdict: Runtime Error):
def gcd(x,y):
    if y==0:
        return x
    return gcd(y,x%y)

MOD = 10**9+7
N = int(input())
A = list(map(int,input().split()))
lcm = 1
for i in A:
    lcm = (lcm*i)//gcd(lcm,i)
	lcm %= MOD
ans = 0
for i in A:
    ans += lcm*pow(i,MOD-2,MOD)

print(ans%MOD)

Buggy submission (verdict: Runtime Error):
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
#import numpy as np

from math import gcd
#from fractions import gcd

def main():
	n=int(input())
	A=list(map(int,input().split()))
	A.sort()
	a=1
	for i in A:
		a=a*i//gcd(a, i)
	ans=0
	for i in A:
		ans+=(a//i)
		ans%=mod
	print(ans)
	
	
	
	
	
	


if __name__ == "__main__":
	main()