Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    slen = len(s)
    cnt_a = 0

    idx = 0
    ans = 0
    while idx<slen:
        while s[idx] == 'A':
            cnt_a += 1
            idx += 1
        
        if idx<slen and idx+1 < slen:
            if s[idx] == 'B' and s[idx+1] == 'C':
                ans += cnt_a
                idx += 2
            else:
                idx += 1
                cnt_a = 0
        else:
            break
    
    print(ans)



solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()
    slen = len(s)
    cnt_a = 0

    idx = 0
    ans = 0
    while idx<slen:
        while idx < slen and s[idx] == 'A':
            cnt_a += 1
            idx += 1
        
        if idx<slen and idx+1 < slen:
            if s[idx] == 'B' and s[idx+1] == 'C':
                ans += cnt_a
                idx += 2
            else:
                idx += 1
                cnt_a = 0
        else:
            break
    
    print(ans)



solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def ok(n):
    s = str(n)
    if len(set(s)) == 1:
        return True
    return False

def solve():
    n = f()[0]
    for i in range(n, 1000):
        if ok(i):
            print(i)
            return

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    v = f()

    a = [ v[i] for i in range(n) if i%2 == 0]
    b = [ v[i] for i in range(n) if i%2 == 1]

    cnt_a = {}
    cnt_b = {}
    for i in a:
        if i in cnt_a:
            cnt_a[i] += 1
        else:
            cnt_a[i] = 1
    
    for i in b:
        if i in cnt_b:
            cnt_b[i] += 1
        else:
            cnt_b[i] = 1

    ncnt_a = sorted(cnt_a.items(), key = lambda x:x[1])
    ncnt_b = sorted(cnt_b.items(), key = lambda x:x[1])

    

    if ncnt_a[0][0]!=ncnt_b[0][0]:
        print(n -ncnt_a[0][1]- ncnt_b[0][1])
    else:
        ans1 = n -ncnt_a[1][1]- ncnt_b[0][1]
        ans2 = n -ncnt_a[0][1]- ncnt_b[1][1]
        print(min(ans1, ans2))



solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    v = f()

    a = [ v[i] for i in range(n) if i%2 == 0]
    b = [ v[i] for i in range(n) if i%2 == 1]

    cnt_a = {}
    cnt_b = {}
    for i in a:
        if i in cnt_a:
            cnt_a[i] += 1
        else:
            cnt_a[i] = 1
    
    for i in b:
        if i in cnt_b:
            cnt_b[i] += 1
        else:
            cnt_b[i] = 1

    ncnt_a = sorted(cnt_a.items(), key = lambda x:-x[1])
    ncnt_b = sorted(cnt_b.items(), key = lambda x:-x[1])

    

    if ncnt_a[0][0]!=ncnt_b[0][0]:
        print(n -ncnt_a[0][1]- ncnt_b[0][1])
    else:
        ans1 = n - ncnt_b[0][1] - (ncnt_a[1][1] if len(ncnt_a)>1 else 0)
        ans2 = n -ncnt_a[0][1]- (ncnt_b[1][1] if len(ncnt_b)>1 else 0)
        print(min(ans1, ans2))



solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    for i in range(1,4):
        if a*b*c%2 == 1:
            print("Yes")
            return
    
    print('No')
    

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    for i in range(1,4):
        if a*b*i%2 == 1:
            print("Yes")
            return
    
    print('No')
    

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    h,w = f()
    g = [ f() for i in range(h)]

    cnt = 0
    ans = []
    for i in range(h):
        for j in range(w):
            if g[i][j]%2 == 0:
                continue
            else:
                if (j+1<w and g[i][j+1]%2 == 1) or i+1 == h:
                    g[i][j+1] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+1, j+1+1)]

                elif i+1<h:
                    g[i+1][j] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+2, j+1)]

    
    print(cnt)
    for i in ans:
        print(i[0], i[1], i[2], i[3])



solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    h,w = f()
    g = [ f() for i in range(h)]

    cnt = 0
    ans = []
    for i in range(h):
        for j in range(w):
            if g[i][j]%2 == 0:
                continue
            else:
                if j+1<w  and (g[i][j+1]%2 == 1 or i+1 == h):
                    g[i][j+1] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+1, j+1+1)]

                elif i+1<h:
                    g[i+1][j] += 1
                    cnt+=1
                    ans += [(i+1, j+1, i+2, j+1)]

    
    print(cnt)
    for i in ans:
        print(i[0], i[1], i[2], i[3])



solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,k = f()
    for i in range(a, b+1):
        if i - a<=k-1 or b-i<=k-1:
            print(i)

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,k = f()
    s = set()
    for i in range(a, min(a+k, b)):
        s.add(i)
    

    for i in range(max(a,b+1-k), b+1):
        s.add(i)
    
    s = sorted(list(s))
    for i in s:
        print(i)

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n,a = f()
    print(n*n - a)

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    n = f()[0]
    a = f()[0]
    print(n*n - a)

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()

    for i in range(len(s)/2):
        if s[i] = s[len(s)-1 -i]:
            print('No')
            return
    
    print('Yes')

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input()


    for i in range(len(s)//2):
        if s[i] != s[len(s)-1 -i]:
            print('No')
            return
    
    print('Yes')

solve()
Buggy python submission (verdict: Runtime Error):
// Created by sz
#include <bits/stdc++.h>
using namespace std;

const int N = 1e5 + 5;
int n;
long long a[N];


long long gcd(long long a, long long b){
    return b ? gcd(b, a % b) : a;
}



int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin>>n;
    
    for (int i = 1; i <= n; i++)cin>>a[i];
    
    long long  lcm = 1;
    
    for (int i = 1; i <= n; i++){
        lcm = lcm/gcd(a[i], lcm)*a[i];
    }
    cout<<lcm<<endl;
    
    
    return 0;
}



Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def gcd(a, b):
    return gcd(b, a % b) if b else a


def solve():
    n = f()[0]
    a = []
    for i in range(n):
        a.append(f()[0])

    lcm = a[0]

    for i in range(1,n):
        lcm = lcm*a[i]//gcd(lcm, a[i])

    print(lcm)


solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input().strip()
    print(s[0]+ str(lne(s)-2)+s[-1])

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    s = input().strip()
    print(s[0]+ str(len(s)-2)+s[-1])

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a = [1,3,5,7,8,10,12]
    b = [4,6,9,11]
    c = [2]

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y ={}

    if some_dic[x] == some_dic[y]:
        print('Yes')
    else:
        print('No')

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a = [1,3,5,7,8,10,12]
    b = [4,6,9,11]
    c = [2]

    some_dic = {}

    for i in a:
        some_dic[i] = 1
    for i in b:
        some_dic[i] = 2
    for i in c:
        some_dic[i] = 3

    x , y = f()

    if some_dic[x] == some_dic[y]:
        print('Yes')
    else:
        print('No')

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os
import numpy as np

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,c = input(), input(), input()
    if a[-1]== b[0] and b[-1] = c[0]:
        print('YES')
    else:
        print('NO')
    

solve()


Fixed submission:
import sys, os
import numpy as np

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b,c = input().split()
    if a[-1]== b[0] and b[-1] == c[0]:
        print('YES')
    else:
        print('NO')
    

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def fac(n):
    if n== 1 or n == 0:
        return 1
    return n * fac(n-1)

def comb(n, k):
    return fac(n)/(fac(k) * fac(n-k))

def solve():
    n, a, b = f()
    v = f()
    
    v = sorted(v, reverse = True)

    c = v[a-1]

    cnt1 = 0
    total = 0

    for i in range(n):
        if v[i] == c:
            total += 1
            if i < a:
                cnt1 += 1


    print("{:.7f}".format(sum(v[0:a])/a))
    if v[0] == c:
        ans = 0
        for i in range(a, b+1):
            ans += comb(total, i)
        print(ans)
    else:
        print(int(comb(total, cnt1)))

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def fac(n):
    if n== 1 or n == 0:
        return 1
    return n * fac(n-1)

def comb(n, k):
    if k >n:
        return 0
    return fac(n)/(fac(k) * fac(n-k))

def solve():
    n, a, b = f()
    v = f()
    
    v = sorted(v, reverse = True)

    c = v[a-1]

    cnt1 = 0
    total = 0

    for i in range(n):
        if v[i] == c:
            total += 1
            if i < a:
                cnt1 += 1


    print("{:.7f}".format(sum(v[0:a])/a))
    if v[0] == c:
        ans = 0
        for i in range(a, b+1):
            ans += comb(total, i)
        print(int(ans))
    else:
        print(int(comb(total, cnt1)))

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a , b = input(), input()
    if a == 'H':
        print(b)
    else:
        if b == 'D':
            print('H')
        else:
            print('D')

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a , b = input().split()
    if a == 'H':
        print(b)
    else:
        if b == 'D':
            print('H')
        else:
            print('D')

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    if x >= 1200:
        print("ARC")
    else print("ABC")

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    if x >= 1200:
        print("ARC")
    else:
        print("ABC")

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()
    ans = (x//11)*2 
    remain = x%11
    add = 0
    if remain!=0:
        add = (2 if remain >6 else 1)
    
    print(ans + add)

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    x = f()[0]
    ans = (x//11)*2 
    remain = x%11
    add = 0
    if remain!=0:
        add = (2 if remain >6 else 1)
    
    print(ans + add)

solve()
Buggy python submission (verdict: Time Limit Exceeded):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    k,s = f()
    
    cnt = 0
    for i in range(k+1):
        for j in range(k+1):
            for m in range(k+1):
                if i + j + m == s:
                    cnt += 1

    
    print(cnt)


solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    k,s = f()
    
    cnt = 0
    for i in range(k+1):
        for j in range(k+1):
            if s-i -j >=0 and s-i -j<= k:
                cnt += 1

    
    print(cnt)


solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == '+':
        print(a+b)
    elif op == '-':
        print(a-b)

solve()

Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a, op, b = input().split()
    a = int(a)
    b = int(b)
    if op == '+':
        print(a+b)
    elif op == '-':
        print(a-b)

solve()
Buggy python submission (verdict: Runtime Error):
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')



def solve():
    a,b,h = f()
    print((a+b)*h//2)

solve()


Fixed submission:
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')



def solve():
    a = f()[0]
    b = f()[0]
    h = f()[0]
    print((a+b)*h//2)

solve()
Buggy python submission (verdict: Runtime Error):
K = int( input() )
S = input()

if len(S) <= K:
  print( S )
else:
  print( S[:K] + '...' )

Fixed submission:
N = input()
first = int(N) % 10
if first in ( 2, 4, 5, 7, 9 ):
  ret = 'hon'
elif first in ( 0, 1,6,8 ):
  ret = 'pon'
else:
  ret = 'bon'

print( ret )
Buggy python submission (verdict: Runtime Error):
def isPrime(n):
    if (n > 2 and n % 2 == 0) return False
    i = 3
    while (i <= mySqrt(n)):
        if (n % i == 0):
            return False
        i += 2;
    return n > 1
 
 
n = int(input())
while !isPrime(n):
  	n += 1
print(n)

Fixed submission:
from math import sqrt


def isPrime(n):
    if n > 2 and n % 2 == 0: return False
    i = 3
    while i <= sqrt(n):
        if n % i == 0:
            return False
        i += 2
    return n > 1


n = int(input())
while not isPrime(n):
    n += 1
print(n)

Buggy python submission (verdict: Runtime Error):
def isPrime(n):
    if (n > 2 and n % 2 == 0) return False
    i = 3
    while (i <= mySqrt(n)):
        if (n % i == 0):
            return false
        i += 2;
    return n > 1


n = int(input())
while !isPrime(n):
  n += 1
print(n)


Fixed submission:
from math import sqrt


def isPrime(n):
    if n > 2 and n % 2 == 0: return False
    i = 3
    while i <= sqrt(n):
        if n % i == 0:
            return False
        i += 2
    return n > 1


n = int(input())
while not isPrime(n):
    n += 1
print(n)
Buggy python submission (verdict: Runtime Error):
a = input('')
b = input('')
if b[:-1] == a:
  return 'Yes'

Fixed submission:
a = input('')
b = input('')

if b[:-1] == a:
    print('Yes')

else:
    print('No')
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c,k = map(int, input().split())

total = 0

while k > 0 and a > 0:
    total += 1
    a -= 1
    k -= 1
    
while k > 0 and b > 0:
    total += 0
    b -= 1
    k -= 1

while k > 0 and c > 0:
    total -= 1
    c -= 1
    k -= 1

print(total)


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

total = 0

if k > a:
    k = k-a
    total += a

elif k == a:
    k = 0
    total = a

elif k < a:
    total = k
    k = 0

if k > b:
    k = k-b

elif k == b:
    k = 0

elif k < b:
    k = 0

if k > c:
    total -= c
    k -= c

elif k == c:
    total -= k
    k = 0

elif k < c:
    total -= k
    k = 0
    
print(total)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
ans=0

ans=math.ceil((b-1)/(a-1))
print(ans)

Fixed submission:
import math
a,b=map(int,input().split())
ans=0

ans=math.ceil((b-1)/(a-1))
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
L=list(map(int,input().split()))
L.sort()

m=int(n/2)
cnt=0
for i in range(L[m-1]+1,L[m]+1):
    
    if len(L[:m])==m:
        cnt+=1
        
print(cnt)

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

m=int(n/2)
        
if L[m-1]==L[m]:
    print(0)
else:
    print(L[m]-L[m-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.k=map(int,input().split())
print(n%k)

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

if n%k==0:
    print("0")
else:
    print("1")
Buggy python submission (verdict: Runtime Error):
s=list(input())
res="None"
s.sort()
str="abcdefghijklmnopqrstuvwxyz"
for i in range (len(s)):
    if not(str[i] in s):
        res=str[i]
        break
 
print(res)

Fixed submission:
s=list(input())
res="None"
s.sort()
str="abcdefghijklmnopqrstuvwxyz"

for i in range (26):
    if not(str[i] in s):
        res=str[i]
        break
 
print(res)
Buggy python submission (verdict: Runtime Error):
n=int(input())
a_L=list(input().split())
ans1 :list=[]
ans2 :list=[]

if n==1:
	print(a_L[0])
else:
	for i in range(0,n,2):
		ans2.append(a_L[i])
	for i in range(1,n,2):
		ans1.append(a_L[i])


if n%2==0:
	ans1.reverse()
	print(*(ans1+ans2))
else:
	ans2.reverse()
	print(*(ans2+ans1))

Fixed submission:
n=int(input())
a_L=list(input().split())
ans1=[]
ans2=[]

if n==1:
	print(a_L[0])
else:
	for i in range(0,n,2):
		ans2.append(a_L[i])
	for i in range(1,n,2):
		ans1.append(a_L[i])


if n%2==0:
	ans1.reverse()
	print(*(ans1+ans2))
else:
	ans2.reverse()
	print(*(ans2+ans1))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split())
if a>=c:
  print(a-c,b)
else if a+b>=c:
  print(0,a+b-c)
else:
  print(0,0)

Fixed submission:
a,b,c=map(int,input().split())
aa=max(0,a-c)
print(aa,max(0,a+b-aa-c))
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input().split)
if b>=c:
  print(a*c)
else:
  print(a*b)

Fixed submission:
a,b,c=map(int,input().split())
if a*b>=c:
  print(c)
else:
  print(a*b)
Buggy python submission (verdict: Runtime Error):
w,h,x,y=map(int,input().split())
if x==w/2 and x==h/2:
  a==1
else:
  a==0
print(w*h/2,a)

Fixed submission:
w,h,x,y=map(int,input().split())
if x==w/2 and y==h/2:
  a=1
else:
  a=0
print(w*h/2,a)
Buggy python submission (verdict: Runtime Error):
def gcd(a, b):
  if b == 0:
    return a
  return gcd(b, a%b)
n = int(input())
A = input().split()
m = [int(a) for a in A]
ans = 0
for i in range(n):
    B = m[:]
    B.pop(i)
    gcm = gcd(B[0], B[1])
    cand = gcm
    for j in range(len(B)-2):
        cand = gcd(B[j+2], gcm)
    if cand > ans:
        ans = cand
print(ans)


Fixed submission:
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)

N=int(input())
A=[int(i) for i in input().split()]
X=[0 for i in range(N)]
Y=[0 for i in range(N)]
for i in range(1,N):
    X[i]=gcd(X[i-1],A[i-1])
for i in range(N-1)[::-1]:
    Y[i]=gcd(Y[i+1],A[i+1])
Z=[gcd(X[i],Y[i]) for i in range(N)]
print(max(Z))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n = int(input())
A = input().split()
m = [int(a) for a in A]
ans = 0
for i in range(n):
    B = m[:]
    B.pop(i)
    cand = gcd_list(B)
    if cand > ans:
        ans = cand
print(ans)

Fixed submission:
def gcd(x,y):
    if x<y:
        x,y=y,x
    if y==0:
        return x
    if x%y==0:
        return y
    else:
        return gcd(y,x%y)

N=int(input())
A=[int(i) for i in input().split()]
X=[0 for i in range(N)]
Y=[0 for i in range(N)]
for i in range(1,N):
    X[i]=gcd(X[i-1],A[i-1])
for i in range(N-1)[::-1]:
    Y[i]=gcd(Y[i+1],A[i+1])
Z=[gcd(X[i],Y[i]) for i in range(N)]
print(max(Z))
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
int s
if A>=B:
    s=A
else:
    s=B
S = 2*s - 1
print(S)

Fixed submission:
A, B = map(int, input().split())
s = 0
if A>=B:
    s=A
    A=A-1
else:
    s=B
    B=B-1
S = s
if A>=B:
    s=A
    A=A-1
else:
    s=B
    B=B-1
S=S+s
print(S)
Buggy python submission (verdict: Runtime Error):
N = int(input())
H = []*100
H[:] = map(int, input().split())
ct = 1
for i in range(N-1):
    max = max(H[:i+1])
    if H[i+1] >= max:
        ct += 1
print(ct)

Fixed submission:
N = int(input())
H = input().split()
H = [int(h) for h in H]
ct = 1
for i in range(N-1):
    maxim = max(H[:i+1])
    if H[i+1] >= maxim:
        ct += 1
print(ct)