Buggy python submission (verdict: Time Limit Exceeded):
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = sorted(_x)
dis = [0 for z in range(N-1)]
z = [0 for z in range(N)]
ans = 1
if N == 1:
    print(abs(x[0]-start))
else:
    for i in range(N-1):
        dis[i] = x[i+1] - x[i]
    for i in range(N):
        z[i] = abs(x[i]-start)
    D = min(dis)
    ans = 1
    for d in reversed(range(2,D+1)):
        count = 0
        for j in range(N):
            if z[j] % d == 0:
                count += 1
            else:
                break
        if count == N:
            ans = d
            break
    print(ans)


Fixed submission:
import math
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = [0 for y in range(N)]
for i in range(N):
    x[i] = abs(_x[i] - start)
g = x[0]
for i in range(N):
    g = math.gcd(g,x[i])
print(g)
ans = 1

Buggy python submission (verdict: Time Limit Exceeded):
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = sorted(_x)
dis = [0 for z in range(N-1)]
z = [0 for z in range(N)]
ans = 1
if N == 1:
    print(abs(x[0]-start))
else:
    for i in range(N-1):
        dis[i] = x[i+1] - x[i]
    for i in range(N):
        z[i] = abs(x[i]-start)
    D = min(dis)
    ans = 1
    for d in range(2,D+1):
        count = 0
        for j in range(N):
            if z[j] % d == 0:
                count += 1
            else:
                break
        if count == N:
            ans = d
    print(ans)


Fixed submission:
import math
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = [0 for y in range(N)]
for i in range(N):
    x[i] = abs(_x[i] - start)
g = x[0]
for i in range(N):
    g = math.gcd(g,x[i])
print(g)
ans = 1

Buggy python submission (verdict: Time Limit Exceeded):
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = sorted(_x)
dis = [0 for z in range(N-1)]
count = 0
ans = 1
if N == 1:
    print(abs(x[0]-start))
else:
    for i in range(N-1):
        dis[i] = x[i+1] - x[i]
    D = min(dis)
    ans = 1
    for d in range(2,D+1):
        cite = start
        while True:
            if cite > x[N-1]:
                break
            if cite in x:
                count += 1
            cite += d
        cite = start
        while True:
            if cite < x[0]:
                break
            if cite in x:
                count += 1
            cite -= d
        if count == N:
            ans = d
        count = 0
    print(ans)


Fixed submission:
import math
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = [0 for y in range(N)]
for i in range(N):
    x[i] = abs(_x[i] - start)
g = x[0]
for i in range(N):
    g = math.gcd(g,x[i])
print(g)
ans = 1

Buggy python submission (verdict: Time Limit Exceeded):
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = sorted(_x)
dis = [0 for z in range(N-1)]
count = 0
if N == 1:
    print(abs(x[0]-start))
else:
    for i in range(N-1):
        dis[i] = x[i+1] - x[i]
    D = min(dis)
    ans = 1
    for d in range(1,D+1):
        cite = start
        while True:
            if cite > x[N-1]:
                break
            if cite in x:
                count += 1
            cite += d
        cite = start
        while True:
            if cite < x[0]:
                break
            if cite in x:
                count += 1
            cite -= d
        if count == N:
            ans = d
        count = 0
    print(ans)


Fixed submission:
import math
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = [0 for y in range(N)]
for i in range(N):
    x[i] = abs(_x[i] - start)
g = x[0]
for i in range(N):
    g = math.gcd(g,x[i])
print(g)
ans = 1

Buggy python submission (verdict: Time Limit Exceeded):
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = sorted(_x)
dis = [0 for z in range(N-1)]
mark = [False for z in range(N)]
if N == 1:
    print(abs(x[0]-start))
else:
    for i in range(N-1):
        dis[i] = x[i+1] - x[i]
    D = min(dis)
    ans = 1
    for d in range(1,D+1):
        cite = start
        while True:
            if cite > x[N-1]:
                break
            if cite in x:
                mark[x.index(cite)] = True
            cite += d
        cite = start
        while True:
            if cite < x[0]:
                break
            if cite in x:
                mark[x.index(cite)] = True
            cite -= d
        if all(mark):
            ans = d
        mark = [False for z in range(N)]
    print(ans)


Fixed submission:
import math
N,start = [int(x) for x in input().split()]
_x = [int(y) for y in input().split()]
x = [0 for y in range(N)]
for i in range(N):
    x[i] = abs(_x[i] - start)
g = x[0]
for i in range(N):
    g = math.gcd(g,x[i])
print(g)
ans = 1