Buggy python submission (verdict: Runtime Error):
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd

N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in reversed(range(len(As)-1)):
    right_gcds.append(gcd(right_gcds[i-1], As[i]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Buggy python submission (verdict: Runtime Error):
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd

N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in reversed(range(len(As)-1)):
    right_gcds.append(gcd(right_gcds[i-1], As[i]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

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

N = int(input())
As = list(map(int, input().split()))

left_gcds = [fractions.gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(fractions.gcd(left_gcds[i-1], As[i]))

right_gcds = [fractions.gcd(As[-1], As[-1])]
for i in reversed(range(len(As)-1)):
    right_gcds.append(fractions.gcd(right_gcds[i-1], As[i]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(fractions.gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

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

N = int(input())
As = list(map(int, input().split()))

left_gcds = [math.gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(math.gcd(left_gcds[i-1], As[i]))

right_gcds = [math.gcd(As[-1], As[-1])]
for i in reversed(range(len(As)-1)):
    right_gcds.append(math.gcd(right_gcds[i-1], As[i]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(math.gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Buggy python submission (verdict: Time Limit Exceeded):

N = int(input())
As = list(map(int, input().split()))
N, As

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)

    return divisors

kous = list(map(make_divisors, As))
all = []
for v in kous:
    all += v
all = sorted(list(set(all)), reverse=True)

ans = 1
i = 0
for v in all:
    count = 0
    for k in kous:
        if v in k:
            count += 1
    if count >= N-1:
        ans = all[i]
        break
    i+=1
    
print(ans)


Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
As = list(map(int, input().split()))
N, As

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)

    return divisors

kous = list(map(make_divisors, As))
all = []
for v in kous:
    all += v
all = sorted(list(set(all)), reverse=True)

counts = []
for v in all:
    count = 0
    for a in As:
        if v in make_divisors(a):
            count += 1
    counts.append(count)


ans = 1
for i in range(len(counts)):
    if counts[i]>=N-1:
        ans = all[i]
        break
print(ans)

Fixed submission:
import sys
if sys.version_info.minor >= 5:
    from math import gcd
else:
    from fractions import gcd



N = int(input())
As = list(map(int, input().split()))

left_gcds = [gcd(As[0], As[0])]
for i in range(1, len(As)):
    left_gcds.append(gcd(left_gcds[i-1], As[i]))

right_gcds = [gcd(As[-1], As[-1])]
for i in range(1, len(As)):
    right_gcds.append(gcd(right_gcds[i-1], As[-(i+1)]))
right_gcds.reverse()

gcds = []
for i in range(N):
    if i == 0:
        gcds.append(right_gcds[1])
    elif i == N-1:
        gcds.append(left_gcds[-2])
    else:
        gcds.append(gcd(left_gcds[i-1], right_gcds[i+1]))
print(max(gcds))