Buggy python submission (verdict: Runtime Error):
from functools import reduce
import math
n,x=map(int,input().split())
l=list(map(int,input().split()))
if n==1: ans=abs(l[0]-x)
else: ans=reduce(math.gcd,[abs(x-c) for c in l if abs(c)!=abs(x)])
print(ans)


Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
from functools import reduce
import math
n,x=map(int,input().split())
l=list(map(int,input().split()))
ans=abs(l[0]-x)
ans=reduce(math.gcd,[abs(x-c) for c in l if c!=abs(x)])
print(ans)



Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
print(gcd_list(l) if len(l)>1 else l[0])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n,x=map(int,input().split())
l=[]
for c in list(map(int,input().split())):
	if c==x:
		continue
	else:
		l.append(abs(c-x))

print(gcd_list(l) if len(l)>1 else l[0])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
del l[l.index(0)]
print(gcd_list(l) if len(l)>1 else l[0])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce


def gcd_list(numbers):
    return reduce(math.gcd, numbers)
n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
print(gcd_list(l) if len(l)>1 else l[0])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

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

n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
if len(l)<2:
	print(l[0])
else:
	l.append(math.gcd(l[0],l[1]))
	for x in range(n-2):
		l.append(math.gcd(l[-1],l[x+2]))
	print(l[-1])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

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

n,x=map(int,input().split())
l=[abs(c-x) for c in list(map(int,input().split()))]
l.append(math.gcd(l[0],l[1]))
for x in range(n-2):
	l.append(math.gcd(l[-1],l[x+2]))
print(l[-1])

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))

Buggy python submission (verdict: Runtime Error):
n,x=map(int,input().split())
l=list(map(int,input().split()))
sub=[abs(c-x) for c in l]

import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
print(gcd_list(sub))

Fixed submission:
def gcd(a,b):
        while b:
            a,b=b,a%b
        return a
def solve(lis,x):
    if len(lis)==1:
        return abs(lis[0]-x)
    lis=[abs(c-x) for c in lis]
    ans=gcd(lis[0],lis[1])
    for x in lis[2:]:
        if x!=0:
            ans=gcd(ans,x)
    return ans 
n,x=map(int,input().split())
l=list(map(int,input().split()))
print(solve(l,x))