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

def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]
    if not x in points:
        points.append(x)

    buf = [abs(points[i + 1] - points[i]) for i in range(len(points) - 1)]
    print(reduce(lambda a,b: euclid(a, b), bur))


Fixed submission:
from functools import reduce

def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]

    buf = [abs(p - x) for p in points]
    print(reduce(lambda a,b: euclid(a, b), buf))

Buggy python submission (verdict: Time Limit Exceeded):
def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]
    if not x in points:
        points.append(x)

    buf = [abs(points[i + 1] - points[i]) for i in range(len(points) - 1)]
    while len(buf) > 1:
        buf = [euclid(buf[i + 1], buf[i]) for i in range(len(buf) - 1)]

    print(buf[0])

Fixed submission:
from functools import reduce

def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]

    buf = [abs(p - x) for p in points]
    print(reduce(lambda a,b: euclid(a, b), buf))

Buggy python submission (verdict: Runtime Error):
    def euclid(a, b):
        if a < b:
            a, b = (b, a)
     
        while True:
            r = a % b
            if r == 0:
                break
            a, b = (b, r)
     
        return b
     
     
    if __name__ == '__main__':
        n, x = tuple(map(int, input().split()))
        points = [int(x) for x in input().split()]
        if not x in points:
            points.append(x)
     
        buf = [abs(points[i + 1] - points[i]) for i in range(len(points) - 1)]
        while len(buf) > 1:
            buf = [euclid(buf[i + 1], buf[i]) for i in range(len(buf) - 1)]
     
        print(buf[0])

Fixed submission:
from functools import reduce

def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]

    buf = [abs(p - x) for p in points]
    print(reduce(lambda a,b: euclid(a, b), buf))

Buggy python submission (verdict: Time Limit Exceeded):
n, x = tuple(map(int, input().split()))
points = [int(x) for x in input().split()]
points.append(x)
points.sort()

ds = [points[i + 1] - points[i] for i in range(len(points) - 1)]
for m in range(min(ds), 0, -1):
    if all([x % m == 0 for x in ds]):
        print(m)
        break


Fixed submission:
from functools import reduce

def euclid(a, b):
    if a < b:
        a, b = (b, a)

    while True:
        r = a % b
        if r == 0:
            break
        a, b = (b, r)

    return b


if __name__ == '__main__':
    n, x = tuple(map(int, input().split()))
    points = [int(x) for x in input().split()]

    buf = [abs(p - x) for p in points]
    print(reduce(lambda a,b: euclid(a, b), buf))