Buggy python submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy python submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy python submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)
    
    






Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy python submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy python submission (verdict: Runtime Error):
import math
ans=0
c=0
N = int(input())
A = [int(i) for i in input().split()] 
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
print(L,R)
for i in range(N):
    if i==0 or i==N-1:
        c=max(L[i],R[i])
        if c>=ans:
            ans=c
    else:
        c=math.gcd(L[i],R[i])
        if c>=ans:
            ans=c
print(ans)

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))

Buggy python submission (verdict: Runtime Error):
import math
ans=0
N = int(input())
A = [int(i) for i in input().split()] 
B=A
L=[1]*N
R=[1]*N
L[0]=1
L[1]=A[0]
R[N-1]=1
R[N-2]=A[N-1]
for i in range(2,N):
    L[i]=math.gcd(L[i-1],A[i-1])
    R[N-i-1]=math.gcd(R[N-i],A[N-i])
for i in range(N):
    c=math.gcd(L[i],R[i])
    if c>ans:
        ans=c
print(ans)
    

Fixed submission:
from fractions import gcd
n = int(input())
a = list(map(int,input().split()))
left,right = [a[0]]+[0]*(n-1),[0]*(n-1)+[a[n-1]]
arr = [0]*n
for i in range(0,n-1):
  left[i+1] = gcd(left[i],a[i+1])
  right[n-2-i] = gcd(right[n-1-i],a[n-2-i])
arr[0] = right[1]
arr[n-1] = left[n-2]
for i in range(1,n-1):
  arr[i] = gcd(left[i-1],right[i+1])
print(max(arr))