Buggy python submission (verdict: Runtime Error):
import math
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
for i in range(1,n):
    g = math.gcd(g,x[i])
print(g)

Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
import math
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
for i in range(n):
    g = math.gcd(g,x[i])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
n, init = map(int, input().split())
x = list(map(int, input().split()))
def gcd(m,n):
    if n > m:
        gcd(n,m)
    elif m%n == 0:
        return n
    else:
        gcd(n,m%n)
def myabs(x):
    if x < 0:
        return -x
    else:
        return x
g = myabs(x[0]-init)
for i in range(n):
    if g == 1:
        break
    elif (myabs(x[i]-init) % g) != 0:
        g = gcd(g,x[i])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
n, init = map(int, input().split())
y = list(map(int, input().split()))
x = list(map(lambda a: abs(a-init),y))
def gcd(m,n):
    if n > m:
        gcd(n,m)
    elif m%n == 0:
        return n
    else:
        gcd(n,m%n)
g = x[0]
for i in range(n):
    if g == 1:
        break
    elif (x[i] % g) != 0:
        g = gcd(g,x[i])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
n, init = map(int, input().split())
x = list(map(lambda a: abs(int(a)-init), input().split()))
def gcd(m,n):
    if n > m:
        gcd(n,m)
    elif m%n == 0:
        return n
    else:
        gcd(n,m%n)
g = x[0]
for i in range(n):
    if g == 1:
        break
    elif x[i] % g != 0:
        g = gcd(g,x[i])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
import math
n, init = map(int, input().split())
x = list(map(lambda a: abs(int(a)-init), input().split()))
g = x[0]
for i in range(n):
    if g == 1:
        break
    elif x[i] % g != 0:
        g = math.gcd(g,x[i])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
import math
n, init = map(int, input().split())
x = list(map(lambda a: int(a)-init, input().split()))
g = x[0]
for i in range(n-1):
    if g == 1:
        break
    elif x[i+1] % g != 0:
        g = math.gcd(g,x[i+1])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)

Buggy python submission (verdict: Runtime Error):
import math
n, init = map(int, input().split())
x = list(map(lambda a: int(a)-init, input().split()))
g = x[0]
for i in range(n-1):
    g = math.gcd(g,x[i+1])
print(g)


Fixed submission:
n, init = map(int,input().split())
x = list(map(lambda x: abs(int(x)-init), input().split()))
g = x[0]
def gcd(x, y):
    if y == 0:
        return x
    return gcd(y, x%y)
for i in range(1,n):
    g = gcd(g,x[i])
print(g)