Buggy python submission (verdict: Runtime Error):
import math
N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = math.gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)


Fixed submission:
def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a
#(a >= b )

N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = math.gcd(xlist[i],ans)
        ans = min(num,ans)
print(ans)


Fixed submission:
def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a
#(a >= b )

N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = math.gcd(xlist[i],ans)
        ans = min(num,ans)
print(ans)


Fixed submission:
def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a
#(a >= b )

N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
import functools
import math
N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
xlist.sort()
xlist_2 = list(map(lambda x:x - xlist[0], xlist))

if len(xlist) == 1:
    ans = xlist[0] - X
elif len(xlist) >= 2:
    ans = functools.reduce(math.gcd,xlist_2)

print(abs(ans))


Fixed submission:
def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a
#(a >= b )

N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)

Buggy python submission (verdict: Runtime Error):
import math
N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
xlist.sort()

if len(xlist) == 1:
    ans = xlist[0] - X
elif len(xlist) >= 2:
    ans = xlist[1] - xlist[0]
    for i in range(0,N-1):
        num = xlist[i+1] - xlist[i]
        ans = math.gcd(ans,num)

print(ans)


Fixed submission:
def gcd(a,b):
    while b % a:
        a,b = b, a % b
    return a
#(a >= b )

N ,X = list(map(int,input().strip().split()))
xlist = list(map(int,input().strip().split()))
abs_xlist = list(map(lambda x:abs(X - x), xlist))
abs_xlist.sort()
ans = abs_xlist[0]

for i in range(N):
    if abs_xlist[i] % ans != 0:
        num = gcd(abs_xlist[i],ans)
        ans = min(num,ans)
print(ans)