Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()

if N==1:
    print(max(dist))
else:
    m = min(dist)
    dist.remove(m)
    dist_2 = [int(i%m) for i in dist]
    dist_2.sort()
    while len(dist_2)>0 and dist_2[0]==0:
        dist_2.remove(0)
    dist_2.append(m)
    D = max(dist_2)
    for i in reversed(range(1, D+1)): #最大公約数を1から順に考える
        for j in range(len(dist_2)): #全ての数を割ってみる
            if dist_2[j]%i != 0:
                flag = False
                break
            else:
                flag = True
        if flag:
            D = i
            break
    print(D)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()

if N==1:
    print(max(dist))
else:
    m = min(dist)
    dist.remove(m)
    dist_2 = [int(i%m) for i in dist]
    dist_3 = [m]
    for l in range (len(dist_2)):
        if dist_2[l]!=0:
            dist_3.append(dist_2[l])
    D = max(dist_3)
    for i in reversed(range(1, D+1)): #最大公約数を1から順に考える
        for j in range(len(dist_3)): #全ての数を割ってみる
            if dist_3[j]%i != 0:
                flag = False
                break
            else:
                flag = True
        if flag:
            D = i
            break
    print(D)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()

import math
if N==1:
    print(max(dist))
else:
    D = math.gcd(min(dist), max(dist))
    for i in reversed(range(1, D+1)): #最大公約数を1から順に考える
        for j in range(len(dist)): #全ての数を割ってみる
            if dist[j]%i != 0:
                flag = False
                break
            else:
                flag = True
        if flag:
            D = i
            break
    print(D)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()

import math
if N==1:
    print(max(dist))
else:
    D = math.gcd(min(dist), max(dist))
    for i in reversed(range(1, D+1)): #最大公約数を1から順に考える
        for j in range(len(dist)): #全ての数を割ってみる
            if dist[j]%i != 0:
                flag = False
                break
            else:
                flag = True
        if flag:
            D = i
            break
    print(D)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
D = 1

for i in reversed(range(1, min(dist)+1)): #最大公約数を1から順に考える
    for j in range(len(dist)): #全ての数を割ってみる
        if dist[j]%i != 0:
            flag = False
            break
        else:
            flag = True
    if flag:
        D = i
        break
print(D)

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
D = [1]

for i in range(1, min(dist)+1): #最大公約数を1から順に考える
    D.append(i)
    for j in range(len(dist)): #全ての数を割ってみる
        if dist[j]%i != 0 and D.count(i)>=1:
            D.remove(i)
print(max(D))

Fixed submission:
N, X = map(int, input().split())
cities = [int(i) for i in input().split()]
cities.sort()
dist = [int(abs(i-X)) for i in cities]
dist.sort()
 
if N==1:
    print(max(dist))
else:
    while len(dist)>0:
        m = min(dist)
        dist = [int(i%m) for i in dist]
        dist.sort()
        while len(dist)>0 and dist[0]==0:
            dist.remove(0)
        if len(dist)==0:
            break
        else:
            dist.append(m)
    print(m)