Buggy python submission (verdict: Runtime Error):
H, W = map(int, input().split())
N = 0
a_map = []
for i in range(H):
    a = list(map(int, input().split()))
    a_map.append(a)
result = []
for i in range(H):
    for j in range(W):
        if a_map[i][j]%2==1:
            if j < W - 1:
                N += 1
                result.append([i + 1, j + 1, i + 1, j + 2])
                a_map[i][j + 1] += 1;
                a_map[i][j] -= 1;
            elif i < H - 1:
                N += 1;
                result.append([i + 1, j + 1, i + 2, j + 1])
                a_map[i][j] -= 1;
                a_map[i + 1][j] += 1;
print(N)
for a in result:
    print(a[0], a[1], a[2], a[3])

Fixed submission:
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
def gcd(a, b):
    if a >= b:
        return a if b == 0 else gcd(b, a % b)
    else:
        return gcd(b, a)


D = abs(X-x_list[0])
for i in range(0, N):
    D = gcd(D,  abs(x_list[i]-X))

print(D)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
import math
if N ==1:
    print(x_list[0]-X)
    exit()

if N==2:
    g1 = abs(X-x_list[0])
    g2 = math.gcd(g1, x_list[1]-x_list[0])
    print(g2)
    exit()

m0 = abs(X - x_list[0])

D = 10**9
for i in range(N-2):
    m1 = abs(x_list[i] - x_list[i+1])
    m2 = abs(x_list[i] - x_list[i+2])
    g = math.gcd(m1, m2)

    if g <= D:
        D = g
print(D)


Fixed submission:
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
def gcd(a, b):
    if a >= b:
        return a if b == 0 else gcd(b, a % b)
    else:
        return gcd(b, a)


D = abs(X-x_list[0])
for i in range(0, N):
    D = gcd(D,  abs(x_list[i]-X))

print(D)

Buggy python submission (verdict: Runtime Error):
import math
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
if N ==1:
    print(x_list[0]-X)
    exit()

if N==2:
    g1 = abs(X-x_list[0])
    g2 = math.gcd(g1, x_list[1]-x_list[0])
    print(g2)
    exit()

m0 = abs(X - x_list[0])

D = 10**9
for i in range(N-2):
    m1 = abs(x_list[i] - x_list[i+1])
    m2 = abs(x_list[i] - x_list[i+2])
    g = math.gcd(m1, m2)

    if g <= D:
        D = g
print(D)


Fixed submission:
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
def gcd(a, b):
    if a >= b:
        return a if b == 0 else gcd(b, a % b)
    else:
        return gcd(b, a)


D = abs(X-x_list[0])
for i in range(0, N):
    D = gcd(D,  abs(x_list[i]-X))

print(D)

Buggy python submission (verdict: Runtime Error):
import math
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
if N ==1:
    print(x_list[0]-X)
    exit()

m0 = abs(X - x_list[0])

D = 10**9
for i in range(N-1):
    m1 = abs(x_list[i] - x_list[i+1])
    g = math.gcd(m1, m0)

    if D >= g:
        D = g
print(D)


Fixed submission:
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
def gcd(a, b):
    if a >= b:
        return a if b == 0 else gcd(b, a % b)
    else:
        return gcd(b, a)


D = abs(X-x_list[0])
for i in range(0, N):
    D = gcd(D,  abs(x_list[i]-X))

print(D)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
x_list = list(map(int, input().split()))
import math
x_list.sort()
if N ==1:
    print(x_list[0]-X)
    exit()

m0 = abs(X - x_list[0])

D = float("inf")
for i in range(N-1):
    m1 = abs(x_list[i] - x_list[i+1])
    g = math.gcd(m1, m0)

    if g <= D:
        D = g
print(D)


Fixed submission:
N, X = map(int, input().split())
x_list = list(map(int, input().split()))

x_list.sort()
def gcd(a, b):
    if a >= b:
        return a if b == 0 else gcd(b, a % b)
    else:
        return gcd(b, a)


D = abs(X-x_list[0])
for i in range(0, N):
    D = gcd(D,  abs(x_list[i]-X))

print(D)